As others said, phantomJS (and now headless Chrome) are good tools to deal with heavy js websites
Ask HN: What are best tools for web scraping?
71–80 of 243 posts
Re: Ask HN: What are best tools for web scraping?
#72I previously have used WWW::Mechanize in the Perl world, but single page applications with Javascript really require something with a browser engine.
Re: Ask HN: What are best tools for web scraping?
#73I'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?
If you're familiar with writing XPath queries, lxml is great.
Re: Ask HN: What are best tools for web scraping?
#74I have a function to help me search :
def find_r(value, ind, array,stop_word):
indice = ind
for i in array:
indice = value.find(i,indice)+1
end = value.find(stop_word,indice)
return value[indice: end], end
You can use it like that : resulting_text , end_index = find_r(string, start_index, [""], "
To find text it is quite fast and you don't need to master a framworkRe: Ask HN: What are best tools for web scraping?
#75Re: Ask HN: What are best tools for web scraping?
#76This is perhaps the fastest way to screenscrape a dynamically executed website. 1. First go get and run this code, which allows immediate gathering of all text nodes from the DOM: https://github.com/prettydiff/getNodesByType/blob/master/get... 2. Extract the text content from the text nodes and ignore nodes that contain only white space: let text = document.getNodesByType(3), a = 0, b = text.length, output = []; do {…
Re: Ask HN: What are best tools for web scraping?
#77`clj-http`, `enlive`, `cheshire` in case of `clojure` worked fine for me
Re: Ask HN: What are best tools for web scraping?
#78Re: Ask HN: What are best tools for web scraping?
#79It's a very easy to use frontend to PhantomJS. You can code your interactions in JS or CoffeeScript and scrape virtually anything with a few lines of code.
If you need crawling, just pair a CasperJS script with any spider library like the ones mentioned around here.
Re: Ask HN: What are best tools for web scraping?
#80I just tried puppeteer yesterday for the first time. It seems to work very well. My only complaint is that it is very new and does now have a plethora of examples. I previously have used WWW::Mechanize in the Perl world, but single page applications with Javascript really require something with a browser engine.