How Do You Extract a CSS Selector from a Webpage Effectively? or What’s the Best Way to Find the Righ

22 Replies, 1567 Views

If you’re scraping, don’t sleep on XPath! Sometimes it’s way more reliable than css selector from webpage stuff.

But if you’re set on CSS, try this: right-click in DevTools, hit "Copy > Copy selector," then tweak it to be less brittle.

Puppeteer or Playwright can also help test selectors before you commit.

Messages In This Thread



Users browsing this thread: 1 Guest(s)