Earlier quoted context omitted.
Interesting. I was about to start on some web automation and so far I've had hammered into my head that Selenium is the 'language of the internet' or something along those lines. What would be a better solution, if you have any to recommend?
I'd suggest Puppeteer / Playwright. Both are great. Iirc the puppeteer team largely moved to playwright.
The State of Web Scraping in 2021
61–70 of 132 posts
Re: The State of Web Scraping in 2021
#62Another tip, there are a few browser extensions that can record your interactions and generate a playwright script. Here's one: https://chrome.google.com/webstore/detail/headless-recorder/...
npx playwright codegen wikipedia.org
Re: The State of Web Scraping in 2021
#63Another tip, there are a few browser extensions that can record your interactions and generate a playwright script. Here's one: https://chrome.google.com/webstore/detail/headless-recorder/...
When I google, I see it advertised as a "testing" tool.
Can I also use it for scraping? Where would I learn more about doing so?
Re: The State of Web Scraping in 2021
#64Last year I needed some quick scraping and I used a headless Chromium to render webpages and print the HTML then analyze it with C#. I don't remember exactly, but I think it was around 100 or 200 loc, so not exactly something that took long to write. In fact the most difficult thing was to figure how to pass the right args to Chromium. I wonder what does a scraping framework offer?
Re: The State of Web Scraping in 2021
#65Another tip, there are a few browser extensions that can record your interactions and generate a playwright script. Here's one: https://chrome.google.com/webstore/detail/headless-recorder/...
I'm not familiar with "playwright", it doesn't seem to be mentioned in OP either. When I google, I see it advertised as a "testing" tool. Can I also use it for scraping? Where would I learn more about doing so?
Re: The State of Web Scraping in 2021
#66Re: The State of Web Scraping in 2021
#67Re: The State of Web Scraping in 2021
#68Last year I needed some quick scraping and I used a headless Chromium to render webpages and print the HTML then analyze it with C#. I don't remember exactly, but I think it was around 100 or 200 loc, so not exactly something that took long to write. In fact the most difficult thing was to figure how to pass the right args to Chromium. I wonder what does a scraping framework offer?
Just for one example, when you have to get a form, and then submit the form, with the CSRF protection that was in the form... of course you COULD write that yourself by printing HTML and then analyzing it with C# (which triggers more requests to chromium I guess), but you're probably going to wonder why you are reinventing the wheel when you want to be getting on to the domain-specific stuff.
Re: The State of Web Scraping in 2021
#69Last year I needed some quick scraping and I used a headless Chromium to render webpages and print the HTML then analyze it with C#. I don't remember exactly, but I think it was around 100 or 200 loc, so not exactly something that took long to write. In fact the most difficult thing was to figure how to pass the right args to Chromium. I wonder what does a scraping framework offer?
> I wonder what does a scraping framework offer? HTTP requests, HTML parsing, crawling, data extraction, wrapping complex browser APIs etc. Nothing you couldn't do yourself, but like most frameworks, they abstract the messy details so you can get a scraper working quickly without having to cobble together a bunch of libraries or re-invent the wheel.
Re: The State of Web Scraping in 2021
#70Why no mention of selenium? Is it not cool anymore? I have never heard of mechanicalsoup: is it selenium replacement?
It was uncharacteristic of me, because I tend to use boring, older technologies. But this gamble paid off for me.