I kind of don't want to use DOMParser because it's browser-only... my web-scrapers have to evolve every few years as the underlying web pages change, so I really want CI tests, so it's easiest to have something that works in node.
Web scraping with your web browser: Why not?
21–30 of 77 posts
Re: Web scraping with your web browser: Why not?
#22Why do you need a proxy or to worry about CORS? Why not just point your browser to rumble.com and start from there? I've posted here about scraping for example HN with JavaScript. It's certainly not a new idea. 2020: https://news.ycombinator.com/item?id=22788236
> Why do you need a proxy or to worry about CORS?
Not sure about OP, but you might want to point to a proxy depending on the site/content you are scraping and your location. For example, if you are in Canada but you want to scrape in USD, you might need to use a proxy located in the US to get US prices. > Why not just point your browser to rumble.com and start from there?
Some endpoints use simple web application firewall rules that will block IPs. In this case, a rotating proxy can help evade the blocks (and prevent your legitimate traffic from being blocked). Some domains use more sophisticated WAFs like Imperva and will do browser fingerprinting so you'll need even more advanced techniques to scrape successfully.Source: work at a startup that does a lot of scraping and these are issues we've run into. Our entire office network is blocked from some sites due to some early testing without a proxy.
Re: Web scraping with your web browser: Why not?
#23Re: Web scraping with your web browser: Why not?
#24> can you write a web scraper in your browser? The answer is: YES, you can! So why is nobody doing it? Completely agree with this sentiment. I just spent the last couple of months developing a chrome extension, but recently also did an unrleated web scraping project where I looked into all the common tools like beautiful soup, selenium, playwright, pupeteer, etc, etc. All of these tools were needlessly complicated an…
Tampermoney also works around CORs issues with relative ease.
Re: Web scraping with your web browser: Why not?
#25Re: Web scraping with your web browser: Why not?
#26Earlier quoted context omitted.
>bad formatting If you can elaborate, I would very much appreciate it. I'm always interested in doing better. Why use Puppeteer etc. when you don't have to? What is the argument for using these additional tools versus not using them?
You don't have max-width set on the text, so unless you have your browser window resized to very small size the paragraphs will span your whole screen.
Re: Web scraping with your web browser: Why not?
#27Earlier quoted context omitted.
Red text on yellow - you mean the website? Would you like the text to be darker? And Beautiful Soup should be BeautifulSoup. Who makes the rules?
Yes, the website. Better contrast is good. Black on white works great. Margins would also be nice on the left and right. Beautiful Soup is two words. Just look at their website.
Re: Web scraping with your web browser: Why not?
#28Re: Web scraping with your web browser: Why not?
#29Earlier quoted context omitted.
Yes, the website. Better contrast is good. Black on white works great. Margins would also be nice on the left and right. Beautiful Soup is two words. Just look at their website.
Too much contrast makes it hard to read too. (With bonus eye strain.)
I dislike black-on-white and don't understand gray-on-black which seems to be popular now due to gamma settings being cranked up to 11 or something. I try to use some color as an in-between but that may take some time to "perfect".
Re: Web scraping with your web browser: Why not?
#30> can you write a web scraper in your browser? The answer is: YES, you can! So why is nobody doing it? Completely agree with this sentiment. I just spent the last couple of months developing a chrome extension, but recently also did an unrleated web scraping project where I looked into all the common tools like beautiful soup, selenium, playwright, pupeteer, etc, etc. All of these tools were needlessly complicated an…
You might like Tamper monkey. You can add a button to kick it off or whatever your heart desires. Tampermoney also works around CORs issues with relative ease.