简体   繁体   中英

How to add JS support to the Ruby Mechanize gem?

有没有一种方法可以添加JavaScript支持进行机械化,使其能够处理诸如document.location.href=这样的简单重定向?

To support that, you'd only need to extract the href parameter ( using a regex maybe ) and then do :


mech.get(href_param)

As far as I know mechanize supports relative URL's.

If javascript's a must, then I would suggest firewatir . It can automate firefox, and this way you get a free javascript interpreter.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM