title: Managing sessions when scraping with Requests library in python
body: <p>I am having trouble creating and keeping new sessions when I am scraping my page. I am initiating a session within my script using the Requests library and then parsing values to a web form. However, it's is returning a "Your session has timed out" page.</p>
  
  <p>Here is my source:</p>
  
  <pre><code>import requests
  
  session = requests.Session()
  
  params = {'Rctl00$ContentPlaceHolder1$txtName': 'Andrew'}
  r = session.post("https://www.searchiqs.com/NYALB/SearchResultsMP.aspx", data=params)
  print(r.text)
  </code></pre>
  
  <p>The url I want to search from is this <a href="https://www.searchiqs.com/NYALB/SearchAdvancedMP.aspx" rel="nofollow">https://www.searchiqs.com/NYALB/SearchAdvancedMP.aspx</a></p>
  
  <p>I am searching for a Party 1 name called "Andrew". I have identified the form element holding this search box as 'Rctl00$ContentPlaceHolder1$txtName'. The action url is SearchResultsMP.aspx. </p>
  
  <p>When i do it from a browser, it gives the first page of results. When i do it in the terminal it gives me the session expired page. Any ideas?</p>