Live data from Hacker News

Ask HN: What are best tools for web scraping?

news.ycombinator.com

111–120 of 243 posts

Re: Ask HN: What are best tools for web scraping?

#112
post #111

Headless chrome in the form of puppeteer ( https://github.com/GoogleChrome/puppeteer ) or Chromeless ( https://github.com/graphcool/chromeless ) or for smaller gigs use nightmare.js ( http://www.nightmarejs.org/ ). scapy is fine but selenium, phantom, etc are all outdated IMO

> are all outdated IMO

For what reason? Genuine question.

Re: Ask HN: What are best tools for web scraping?

#113
post #102

Always fascinated by how diverse the discussion and answers is for HN threads on web-scraping. Goes to show that "web-scraping" has a ton of connotations, everything from automated-fetching of URLs via wget or cURL, to data management via something like scrapy. Scrapy is a whole framework that may be worthwhile, but if I were just starting out for a specific task, I would use: - requests http://docs.python-requests.o…

lxml has good xpath support too; the best I've seen. I miss good xpath support in some of the other scraping options I've tried in other languages.

Re: Ask HN: What are best tools for web scraping?

#114
If you can get away without a JS environment, do so. Something like scrapy will be much easier than a full browser environment. If you cannot, don’t bother going halfway and just go straight for headless chrome or Firefox. Unfortunately Selenium seems to be past its useful life as Firefox dropped support and chrome has a chrome driver which wraps around it. Phantom.js is woefully out of date and since it’s a different environment than your target site was designed for just leads to problems.

Re: Ask HN: What are best tools for web scraping?

#116
post #111

Headless chrome in the form of puppeteer ( https://github.com/GoogleChrome/puppeteer ) or Chromeless ( https://github.com/graphcool/chromeless ) or for smaller gigs use nightmare.js ( http://www.nightmarejs.org/ ). scapy is fine but selenium, phantom, etc are all outdated IMO

> are all outdated IMO For what reason? Genuine question.

Phantom is woefully out of date, you need a polyfill even for Function.bind. Firefox dropped support for Selenium in 47, and chromedriver only supports it with a wrapper called chromedriver.

Re: Ask HN: What are best tools for web scraping?

#117
post #105
post #67

I maintain ~30 different crawlers. Most of them are using Scrapy. Some are using PhantomJS/CasperJS but they are called from Scrapy via a simple web service. All data (zip files, pdf, html, xml, json) we collect are stored as-is (/path/to/ / / ) and processed later using a Spark pipeline. lxml.html is WAY faster than beautifulsoup and less prone to exception. We have cronjob (cron + jenkins) that trigger dataset upda…

> We use Redis to send task (update / discovery) to our crawlers. Some kind of queue implemented with Redis? How does it work?

Probably not what the GP uses, but Resque does this in Ruby land.

Re: Ask HN: What are best tools for web scraping?

#118
post #67

I maintain ~30 different crawlers. Most of them are using Scrapy. Some are using PhantomJS/CasperJS but they are called from Scrapy via a simple web service. All data (zip files, pdf, html, xml, json) we collect are stored as-is (/path/to/ / / ) and processed later using a Spark pipeline. lxml.html is WAY faster than beautifulsoup and less prone to exception. We have cronjob (cron + jenkins) that trigger dataset upda…

I have a similar set up! How do you monitor for failures and deal with the scrape target changing?

Re: Ask HN: What are best tools for web scraping?

#119

Been getting blocked by recaptcha more and more, do any of these tools handle dealing with that or workarounds by default? Tried routing through proxies and swapping IP addresses, slowing down, etc... Any specific ways people get around that?

The excepted answer on this stack overflow question[1] might help. tl;dr is to build your own chromedriver, but with renamed variables.

[1] https://stackoverflow.com/a/41220267/4079962

Re: Ask HN: What are best tools for web scraping?

#120
One of the challenges with modern day scraping is you need to account for client-side JS rendering.

If you prefer an API as a service that can pre-render pages, I built Page.REST (https://www.page.rest). It allows you to get rendered page content via CSS selectors as a JSON response.

Post reply on HN