title: Post forms using requests on .net website (python)
body: <pre><code>import requests
  
  headers ={
  "Accept":"text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8",
  "Accept-Encoding":"gzip, deflate",
  "Accept-Language":"en-US,en;q=0.5",
  "Connection":"keep-alive",
  "Host":"mcfbd.com",
  "Referer":"https://mcfbd.com/mcf/FrmView_PropertyTaxStatus.aspx",
  "User-Agent":"Mozilla/5.0(Windows NT 10.0; WOW64; rv:40.0) Gecko/20100101 Firefox/40.0"}
  
  a = requests.session()
  soup = BeautifulSoup(a.get("https://mcfbd.com/mcf/FrmView_PropertyTaxStatus.aspx").content)
  
  payload = {"ctl00$ContentPlaceHolder1$txtSearchHouse":"",
  "ctl00$ContentPlaceHolder1$txtSearchSector":"",
  "ctl00$ContentPlaceHolder1$txtPropertyID":"",
  "ctl00$ContentPlaceHolder1$txtownername":"",
  "ctl00$ContentPlaceHolder1$ddlZone":"1",
  "ctl00$ContentPlaceHolder1$ddlSector":"2",
  "ctl00$ContentPlaceHolder1$ddlBlock":"2",
  "ctl00$ContentPlaceHolder1$btnFind":"Search",
  "__VIEWSTATE":soup.find('input',{'id':'__VIEWSTATE'})["value"],
  "__VIEWSTATEGENERATOR":"14039419",
  "__EVENTVALIDATION":soup.find("input",{"name":"__EVENTVALIDATION"})["value"],
  "__SCROLLPOSITIONX":"0",
  "__SCROLLPOSITIONY":"0"}
  
  b = a.post("https://mcfbd.com/mcf/FrmView_PropertyTaxStatus.aspx",headers = headers,data = payload).text
  print(b)
  </code></pre>
  
  <p>above is my code for this website.</p>
  
  <pre><code>https://mcfbd.com/mcf/FrmView_PropertyTaxStatus.aspx
  </code></pre>
  
  <p>I checked firebug out and these are the values of the form data.
  however doing this:</p>
  
  <pre><code>b = requests.post("https://mcfbd.com/mcf/FrmView_PropertyTaxStatus.aspx",headers = headers,data = payload).text
  print(b)
  </code></pre>
  
  <p>throws this error:</p>
  
  <pre><code>[ArgumentException]: Invalid postback or callback argument
  </code></pre>
  
  <p>is my understanding of submitting forms via request correct?</p>
  
  <p><strong>1.open firebug</strong></p>
  
  <p><strong>2.submit form</strong></p>
  
  <p><strong>3.go to the NET tab</strong></p>
  
  <p><strong>4.on the NET tab choose the post tab</strong></p>
  
  <p><strong>5.copy form data like the code above</strong></p>
  
  <p>I've always wanted to know how to do this. I could use selenium but I thought I'd try something new and use requests</p>