---
title: "Comment by OnlineProxy on \"Web Scraping with Python and BeautifulSoup: A Practical Beginner's Guide\" | Hashnode"
description: "the site choice and li.next pagination are solid, but parse_book skips the missing element guards from your own guide. card.h3.a will crash when the h3 is gone,"
url: "https://hashnode.com/posts/web-scraping-with-python-and-beautifulsoup-a-practical-beginner-s-guide-rivrw/6af7f8e91b1c18afb8604fd1/comment/6afa0e656b3c202e04596deb"
---

[Discussion](https://hashnode.com/posts/web-scraping-with-python-and-beautifulsoup-a-practical-beginner-s-guide-rivrw/6af7f8e91b1c18afb8604fd1)

Comment [Web Scraping with Python and BeautifulSoup: A Practical Beginner's Guide](https://hashnode.com/posts/web-scraping-with-python-and-beautifulsoup-a-practical-beginner-s-guide-rivrw/6af7f8e91b1c18afb8604fd1)

[OnlineProxy](https://hashnode.com/@onlineproxyio)

[Nov 15](https://hashnode.com/posts/web-scraping-with-python-and-beautifulsoup-a-practical-beginner-s-guide-rivrw/6af7f8e91b1c18afb8604fd1/comment/6afa0e656b3c202e04596deb)

the site choice and li.next pagination are solid, but parse\_book skips the missing element guards from your own guide. card.h3.a will crash when the h3 is gone, so card.select\_one("h3 a") is safer since it just returns None.

price parsing needs a guard too coz re.sub on Price TBA leaves an empty string and float raises ValueError

[ZyVOP](https://hashnode.com/@zyvop)

[Nov 16](https://hashnode.com/posts/web-scraping-with-python-and-beautifulsoup-a-practical-beginner-s-guide-rivrw/6af7f8e91b1c18afb8604fd1/comment/6afa0e656b3c202e04596deb#reply-6afab6b90cbde0136db34bbe)

Good catch! You're right, missing-element guards should be applied consistently, especially in scraping where HTML structures can change unexpectedly. Using `select_one()` and validating price values before conversion makes the parser more resilient. Thanks for pointing these out!
