I want to get a JavaScript variable from https://admin.booking.com/hotel/hoteladmin in head > script > var token
.
I don't know how this variable is set by the browser because when I get this page from Mechanize I get:
var token = '' || 'empty-token',
Here is the code I use to GET this page:
login_url = "https://admin.booking.com/hotel/hoteladmin"
agent = Mechanize.new
agent.verify_mode= OpenSSL::SSL::VERIFY_NONE
page = agent.get(login_url)