title: Follow a link with Ghost.py
body: <p>I'm trying to use Ghost.py to do some web scraping. I'm trying to follow a link but the Ghost doesn't seem to actually evaluate the javascript and follow the link. My problem is that i'm in an HTTPS session and cannot use redirection. I've also looked at other options (like selenium) but I cannot install a browser on the machine that will run the script. I also have some javascript evaluation further so I cannot use mechanize.</p>
  
  <p>Here's what I do...</p>
  
  <pre><code>## Open the website
  page,resources = ghost.open('https://my.url.com/')
  
  ## Fill textboxes of the form (the form didn't have a name)
  result, resources = ghost.set_field_value("input[name=UserName]", "myUser")
  result, resources = ghost.set_field_value("input[name=Password]", "myPass")
  
  ## Submitting the form
  result, resources = ghost.evaluate( "document.getElementsByClassName('loginform')[0].submit();", expect_loading=True)
  
  ## Print the link to make sure that's the one I want to follow
  #result, resources = ghost.evaluate( "document.links[4].href")
  
  ## Click the link
  result, resources = ghost.evaluate( "document.links[4].click()")
  
  #print ghost.content
  </code></pre>
  
  <p>When I look at ghost.content, I'm still on the same page and result is empty. I noticed that when I add expect_loading=True when trying to evaluate the click, I get a timeout error. </p>
  
  <p>When I try the to run the javascript in a Chrome Developper Tools console, I get </p>
  
  <blockquote>
    <p>event.returnValue is deprecated. Please use the standard
    event.preventDefault() instead.</p>
  </blockquote>
  
  <p>but the page does load up the linked url correctly. </p>
  
  <p>Any ideas are welcome.</p>
  
  <p>Charles</p>