How to use the cookie got from Javascript's document.cookie in Ruby mechanize? -


i'm automate login process using ruby mechanize. because it's complex recreate process in mechanize, choose use existing cookies grabbed browser document.cookie. want know how can use string in ruby mechanize. thanks.

i dont think mechanize runs javascript, you'll have use selenium that.

with selenium, can run arbitrary scripts. example:

driver = selenium::webdriver.for :firefox driver.get("http://some.url") driver.execute_script("console.log('javascript')") driver.close 

Comments

Popular posts from this blog

java - nested exception is org.hibernate.exception.SQLGrammarException: could not extract ResultSet Hibernate+SpringMVC -

sql - Postgresql tables exists, but getting "relation does not exist" when querying -

asp.net mvc - breakpoint on javascript in CSHTML? -