title: Selenium behaves differently between ipython and a file
body: <p>I'm trying to scrape the New York State <a href="https://iapps.courts.state.ny.us/judicialdirectory/JudicialDirectory" rel="nofollow noreferrer">directory of trial judges</a>. The site checks whether javascript is enabled and renders the page with a short warning about needing python. So I've been trying Selenium.</p>
  
  <p>However, when I run the following line by line in ipython or python, it is able to access the page fine. Then, if I run this from the command line (<code>python scraper.py</code>), the site renders with the javascript warning - but only the first time I hit the site. This happens:</p>
  
  <ul>
  <li>regardless of what browser I use,</li>
  <li>whether I run it as a headless browser or not,</li>
  <li>regardless of what cookies I try to set</li>
  </ul>
  
  <p>My code:</p>
  
  <pre><code>import string
  import csv
  from selenium import webdriver
  
  # Start the browser
  browser = webdriver.Firefox()
  browser.get(
      "https://iapps.courts.state.ny.us/judicialdirectory/JudicialDirectory")
  print(browser.title)
  
  # You can run the above 4 lines directly in ipython,
  # but if running from the command line, the previous try will not work
  browser.get(
      "https://iapps.courts.state.ny.us/judicialdirectory/JudicialDirectory")
  print(browser.title)
  </code></pre>
  
  <p>In case it's of import: I'm running this on Windows 10.</p>
  
  <p>Does anyone have any suggestions for how to debug this?</p>