title: How to save state of selenium web driver in python?
body: <p>I am trying to scrape this website: <a href="http://www.infoempleo.com/ofertas-internacionales/" rel="nofollow">http://www.infoempleo.com/ofertas-internacionales/</a>.
  I wanted to scrape by selecting the "Last 15 days" radio button. So I wrote this code.</p>
  
  <pre><code>browser = webdriver.Chrome('C:\Users\Junaid\Downloads\chromedriver\chromedriver_win32\chromedriver.exe')
  new_urls = deque(['http://www.infoempleo.com/ofertas-internacionales/'])
  
  processed_urls = set()
  
  while len(new_urls):
  
  print "------ URL LIST -------"
  print new_urls
  print "-----------------------"
  print
  time.sleep(5)
  
  url = new_urls.popleft()
  processed_urls.add(url)
  
  try:
      print "----------- Scraping ==&gt;",url
      browser.get(url)
      elem = browser.find_elements_by_id("fechapublicacion")[-1]
      if ( elem.is_selected() ):
          print "already selected"
      else:
          elem.click()
  
      html = browser.page_source
  except:
      print "-------- Failed to Scrape, Moving to Next"
      continue
  
  soup = BeautifulSoup(html)
  </code></pre>
  
  <p>I have been able to select the radio button and scrape the first page.
  There is a list of pages at the end like 1, 2, 3..</p>
  
  <p>When moving to the next page, <code>'browser.get(url)'</code> is called which resets the radio button to 'Any Date' instead of 'Last 15 Days'. Which makes the code execute the else statement <code>else: elem.click()</code> to select the radio button again, which open the first page that has been already scraped.</p>
  
  <p>Is there a way around this? Help will be appreciated.</p>