title: Using Python to use a website's search function
body: <p>I am trying to use a search function of a website with this code structure:</p>
  
  <pre><code>&lt;div class='search'&gt;
  &lt;div class='inner'&gt;
  &lt;form accept-charset="UTF-8" action="/gr/el/products" method="get"&gt;&lt;div style="margin:0;padding:0;display:inline"&gt;&lt;input name="utf8" type="hidden" value="&amp;#x2713;" /&gt;&lt;/div&gt;
  &lt;label for='query'&gt;Ενδιαφέρομαι για...&lt;/label&gt;
  &lt;fieldset&gt;
  &lt;input class="search-input" data-search-url="/gr/el/products/autocomplete.json" id="text_search" name="query" placeholder="Αναζητήστε προϊόν" type="text" /&gt;
  &lt;button type='submit'&gt;Αναζήτηση&lt;/button&gt;
  &lt;/fieldset&gt;
  &lt;/form&gt;
  &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>with this python script:</p>
  
  <pre><code>import requests
  from bs4 import BeautifulSoup
  
  headers = {'User-Agent': 'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:40.0) Gecko/20100101 Firefox/40.1'}
  
  
  
  payload = {
      'query':'test'
  }
  
  r = requests.get('http://www.pharmacy295.gr',data = payload ,headers = headers)
  
  soup = BeautifulSoup(r.text,'lxml')
  products = soup.findAll('span', {'class':'name'})
  print(products)
  </code></pre>
  
  <p>This code came as a result of extensive searches on this website on how to do this task, however I never seem to manage to get any search results - just the main page of the website.</p>