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

php - Passing multiple values in a url using checkbox -

compilation - PHP install fails on Ubuntu 14 (make: *** [sapi/cli/php] Error 1) PHP 5.6.20 -

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