Tal*_*boy 7 javascript ruby screen-scraping mechanize nokogiri
我正在使用Mechanize,虽然如果Mechanize不能这样做,我会对Nokogiri开放.
我想在加载所有脚本之后将页面刮掉,而不是事先加载.
我怎么能这样做?
小智 6
我认为Nokogiri,Watir和PhantomJs是一个很好的选择:
b = Watir::Browser.new(:phantomjs)
b.goto URL
doc = Nokogiri::HTML(b.html)
生成的文档将从脚本加载后的时间开始.而phantomjs很不错,因为不需要加载浏览器.