[0] https://github.com/cheeriojs/cheerio [1] https://github.com/Softcadbury/football-peek/blob/master/ser...
Ask HN: What are best tools for web scraping?
41–50 of 243 posts
Re: Ask HN: What are best tools for web scraping?
#42On the pure scraping side, it has a "declarative parsing" to avoid painful plain-old procedural code [1]. You can parse pages by simply specifying a bunch of XPaths and indicating a few filters from the library to apply on those XPath elements, for example CleanText to remove whitespace nonsense, Lower (to lower-case), Regexp, CleanDecimal (to parse as number) and a lot more. URL patterns can be associated to a Page class of such declarative parsing. If declarative becomes too verbose, it can always be replaced locally by writing a plain-old Python method.
A set of applications are provided to visualize extracted data, and other niceties are provided for debug easing. Simply put: « Wonderful, Efficient, Beautiful, Outshining, Omnipotent, Brilliant: meet WebOOB ».
[1] http://dev.weboob.org/guides/module.html#parsing-of-pages
Re: Ask HN: What are best tools for web scraping?
#43Re: Ask HN: What are best tools for web scraping?
#44Re: Ask HN: What are best tools for web scraping?
#45A few similar tools also exist, like https://page.rest/.
Re: Ask HN: What are best tools for web scraping?
#46Re: Ask HN: What are best tools for web scraping?
#47I've actually wrote about this! General tips that I've found from doing more than a few projects [0], and then an overview of Python libraries I use [1]. If you don't want to clock on the links, requests and BeautifulSoup / lxml is all you need 90% of the time. Throw gevent in there and you can get a lot of scraping done in not as much time as you think it would take. And as long as we're talking about web scraping,…
> BeautifulSoup / lxml When should one use one or the other, would you say?
I've heard that `lxml` can choke on certain badly-formed markup, but it's very fast. Personally has never failed on me.
Re: Ask HN: What are best tools for web scraping?
#48Re: Ask HN: What are best tools for web scraping?
#49If you are a programmer, scrapy[0] will be a good bet. It can handle robots.txt, request throttling by ip, request throttling by domain, proxies and all other common nitty-gritties of crawling. The only drawback is handling pure javascript sites. We have to manually dig into the api or add a headless browser invocation within the scrapy handler. Scrapy also has the ability to pause and restart crawls [1], run the cra…
Re: Ask HN: What are best tools for web scraping?
#50I've actually wrote about this! General tips that I've found from doing more than a few projects [0], and then an overview of Python libraries I use [1]. If you don't want to clock on the links, requests and BeautifulSoup / lxml is all you need 90% of the time. Throw gevent in there and you can get a lot of scraping done in not as much time as you think it would take. And as long as we're talking about web scraping,…
> BeautifulSoup / lxml When should one use one or the other, would you say?