-3

What parameters need to be put in regards to this site (www.pyszne.pl) so that the requests function can be executed properly? I need to have a url which leads to the restaurants available under a specific postcode.

here is my code:

import requests

payload = {'myvaluestring':'30-529'}
r = requests.post('https://www.pyszne.pl', data=payload)

print(r.url)

I'm only receiving the same main page url https://www.pyszne.pl/

Booboo
  • 38,656
  • 3
  • 37
  • 60
Sebastian
  • 31
  • 6
  • 1
    Would you know how to open the page you want from a browser? Why do you think you need to post `{'myvaluestring':'30-529'}`? – zvone Nov 02 '19 at 14:47

1 Answers1

0

It's a GET situation, not POST. Try this:

In [1]: import requests                                                                                                                                                                                            

In [2]: r = requests.get("https://www.pyszne.pl/30-529")                                                                                                                                                           

In [3]: r.url                                                                                                                                                                                                      
Out[3]: 'https://www.pyszne.pl/restauracja-krakow-krakow-podgorze-30-529'

I recommend you to do a search on web "what's the difference of HTTP POST and GET".

emremrah
  • 1,733
  • 13
  • 19