title: Beautifulsoup - Submit form data
body: <p>I am trying to programmatically download (open) data from a website using BeautifulSoup. </p>
  
  <p>The website is using a php form where you need to submit input data and then outputs the resulting links apparently within this form. </p>
  
  <p>My approach was as follows</p>
  
  <p>Step 1: post form data via request</p>
  
  <p>Step 2: parse resulting links via BeautifulSoup</p>
  
  <p>However, it seems like this is not working / I am doing wrong as the post method seems not to work and Step 2 is not even possible as no results are available. </p>
  
  <p>Here is my code:</p>
  
  <pre><code>from bs4 import BeautifulSoup
  import requests
  
  def get_text_link(soup):
      'Returns list of links to individual legal texts'
      ergebnisse = soup.findAll(attrs={"class":"einErgebnis"})
      if ergebnisse:
          links = [el.find("a",href=True).get("href") for el in ergebnisse]
      else:
          links = []
      return links
  
  url = "https://www.justiz.nrw.de/BS/nrwe2/index.php#solrNrwe"
  
  # Post specific day to get one day of data
  params ={'von':'01.01.2018', 
       'bis': '31.12.2018',
       "absenden":"Suchen"} 
  response = requests.post(url,data=params)
  content = response.content
  soup = BeautifulSoup(content,"lxml")
  
  resultlinks_to_parse = get_text_link(soup) # is always an empty list
  # proceed from here....
  </code></pre>
  
  <p>Can someone tell what I am doing wrong. I am not really familiar with request post. The form field for "bis" e.g. looks as follows:</p>
  
  <p><code>&lt;input id="bis" type="text" name="bis" size="10" value=""&gt;</code></p>
  
  <p>If my approach is flawed I would appreaciate any hint how to deal with this kind of site. </p>
  
  <p>Thanks!</p>