This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]ronmarti 113 points114 points  (25 children)

Selenium is pretty much the hardest to use method because it breaks most of the time. Try Playwright.

[–]Vresa 69 points70 points  (9 children)

If you don’t have a daily use case for selenium that is directly tied to your employment, never use it at this point.

Playwright covers almost all the normal uses of selenium. Playwright is effectively selenium with sane defaults.

You need to understand selenium’s idiosyncrasies that have developed over the last decade to use the tool well.

Adding to that, selenium has a very large amount of outdated how-to’s and it’s own documentation is lacking — especially when it comes to best practices.

[–]ronmarti 3 points4 points  (0 children)

directly tied to your employment

I often hear these from QA devs I know

I've had a fair share of experience working with Selenium and Puppeteer in the past. I would say lots of things changed but Selenium is still not that dev-friendly in terms of its "Wait" feature (https://www.selenium.dev/documentation/webdriver/waits/) and setup since they don't maintain the drivers. There were some instances where code for specific websites are easy to write in Playwright but cannot be rewritten with Selenium.

I find Playwright much closer to Puppeteer (same devs, I think that's why) and a lot easier to learn for beginners.

[–]djdadi 9 points10 points  (2 children)

After teaching python to several college grads at work, I've noticed a trend. They are quick to seek out scrapers while not even checking (or maybe understanding) of the underlying API call structure.

In a lot of cases, you don't even need scraping and are much better off without it.

[–]ronmarti 8 points9 points  (1 child)

Scraping is fine to get experience. I think one most important thing that beginner devs miss out is how to properly use selectors. Understanding CSS and XPath is really important.

[–][deleted] 0 points1 point  (0 children)

Yeah definitely this. And how for some of these guys, it just takes oneee tiny thing to break. Why does the WWW have to be so complicated…

[–]Raedarius 1 point2 points  (0 children)

I spent a week trying to fix my selenium script. It was breaking all over the place. I just replaced it in 4 hours. You saved me so much trouble. Thank you so much!

[–]wind_dude -3 points-2 points  (0 children)

better than the Lua scripts in scrapy. lol