Settings

Theme

CSS vs. XPath for web scraping – SerpApiPodcast

odysee.com

2 points by ilyazub 3 years ago · 3 comments

Reader

ilyazubOP 3 years ago

Why industry tend to use CSS selectors instead of XPath? What is better to select nodes in HTML: CSS selectors or XPath queries?

We discuss these questions in this episode.

  • forgotmypw17 3 years ago

    What's the verdict?

    I've never tried using CSS selectors, but it seems like they would generally be less flexible and able?

    XPath seems to have worked well for me.

    • Minor49er 3 years ago

      Selectors are typically more concise and easier for developers to use if they have front end development experience. XPath has marginal benefits over it, like referencing parents/ancestors, but you can often construct a selector to target the elements you want anyways. But since they are so similar, it really comes down to what you work faster with

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection