Earlier quoted context omitted.
This was my approach too and it's been working great. Nowadays data isn't rendered directly into HTML anymore, it gets downloaded from some JSON API endpoint. So I use network monitoring tools to see where it's coming from and then inferface with the endpoint directly. I essentially wrote custom clients for someone else's site. One of my scrapers is actually just curl piped into jq. Sometimes they change the API and…
> Can you elaborate? I haven't run into any roadblocks yet but I'm not scraping big sites or sending a massive number of requests. Cloudflare Bot Protection[1] is a popular one. The website is guarded by a layer of code that needs to be executed before continuing. Normal browsers will follow through. It can be hard to bypass. [1]: https://www.cloudflare.com/pg-lp/bot-mitigation-fight-mode/
Ask HN: What are the best tools for web scraping in 2022?
151–160 of 160 posts
Re: Ask HN: What are the best tools for web scraping in 2022?
#152Unpopular opinion, but Bash/Shell Scripting. Seriously, it's probably the fastest way to get things done. For fetching, use cURL. Want to extract particular markup? Use pup[1]. Want to process csv? Use cskit[2]. Or JSON? Use jq[3]. Want to use DB? Use psql. Once you get the hang of shell scripting, you can create simple scrapers by wiring up these utilities in a matter of minutes. The only thing I wish was present wa…
My shot-scraper CLI tool was designed to support this kind of workflow but with a real headless browser inserted into the mix. Means you can do things like this: shot-scraper javascript \ "https://news.ycombinator.com/from?site=simonwillison.net" " Array.from(document.querySelectorAll('.itemlist .athing')).map(el => { const title = el.querySelector('a.titlelink').innerText; const points = parseInt(el.nextSibling.quer…
Re: Ask HN: What are the best tools for web scraping in 2022?
#153As someone that has built and maintained a few scraper tools in my career: hand-written logic and patience because your scraper will break any time upstream changes their HTML. It's an infinite game of whack-a-mole outside your control. Scrapers are very simple, effective and probably one of the least fun things to build.
Re: Ask HN: What are the best tools for web scraping in 2022?
#154Probably the best tool for scraping websites protected by services like cloudflare. https://github.com/ultrafunkamsterdam/undetected-chromedrive...
Re: Ask HN: What are the best tools for web scraping in 2022?
#155Earlier quoted context omitted.
My £0.02 It's usually easier to use an Android emulator like GenyMotion or a rooted Android phone and use HTTPToolkit and/or some certificate bypassing method using Frida or other and then explore APIs through their official apps. I've scraped loads of stuff through unofficial APIs before this way. Most developers don't ever expect people to do this so they're often a bit less secure too. Alternatively sometimes doin…
Have you had any luck with FB this way? There's local history groups I'd dearly like to back up for future generations - plus posts from 6 months+ ago are already hard to get to.
You'd probably be best sticking with web page scraping via something like Puppeteer, but even that'd be difficult.
Re: Ask HN: What are the best tools for web scraping in 2022?
#156As someone that has built and maintained a few scraper tools in my career: hand-written logic and patience because your scraper will break any time upstream changes their HTML. It's an infinite game of whack-a-mole outside your control. Scrapers are very simple, effective and probably one of the least fun things to build.
Apologies for the shameless self-promotion here but it was this very problem that I built puppeteer-heap-snapshot. It decouples the HTML from the scraper and instead we inspect the booted app’s memory. Not near as performant but a lot more reliable. I wrote about it here: https://www.adriancooney.ie/blog/web-scraping-via-javascript...
Re: Ask HN: What are the best tools for web scraping in 2022?
#157I've thought https://www.scrapingbee.com/ looked great, especially their auto rotation of IP addresses.
ScrappingBee is a fantastic paid solution that makes most of the pain of modern web scraping go away. The prices are not very friendly though...
Re: Ask HN: What are the best tools for web scraping in 2022?
#158Re: Ask HN: What are the best tools for web scraping in 2022?
#159I have had some luck running puppeteer in a nodejs app hosted at glitch.com. I spring for the (cheap) paid hosting and get several containers for dev/test/prod, web based ide. Obviously, this would only scale to a point. In my case I just need a single client automating interaction with a single site. If I really needed scale, I'd probably use one of the services listed elsewhere. Of course, if you don't need a full…
Re: Ask HN: What are the best tools for web scraping in 2022?
#160Has anybody created anything similar to Portia for scraping? I'd love to self host or pay a nominal fee to allow my team to create / adjust scrapers via a UI
RTILA is a very useful visual scraper, my recommendation to a similar question from 2 years ago is just as valid today: https://news.ycombinator.com/item?id=24421092