can mechanize read ajax? (ruby)

巧了我就是萌 提交于 2020-01-05 17:36:35

问题


can I get the correct data/text that is displayed via AJAX using mechanize in ruby?

Or is there any other scripting gem that would allow me to do so?


回答1:


Mechanized cannot read data displayed by JavaScript, because it does not implement a JavaScript engine (in other words, it can't run it). You'll need a browser to do that, or a program that automates a browser to do it for you. WATIR is one such program.




回答2:


You can use WATIR with webdriver which is a console only, headless browser.



来源:https://stackoverflow.com/questions/3852678/can-mechanize-read-ajax-ruby

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!