DEV Community

Discussion on: Web Scraping with CSS Selectors using Python

Collapse
 
steelwolf180 profile image
Max Ong Zong Bao

Not all websites auto generate HTML tags, in fact there will be times it's much better to just use xpath.

Since there may not be websites without any class name, id or HTML tags for you to select when it is loaded due to it being generated on the fly through other methods like JavaScript to prevent scrapers from being used.

Collapse
 
dmitryzub profile image
Dmitriy Zub ☀️ • Edited

@steelwolf180 Thank you for your reply! This is exactly was is being written in this blog post: "Many modern websites use autogenerated CSS selectors", many, not all of them :-) Using XPath is surely a great idea from the start, but this was not the topic of this blog post.