I have application which pulls lottery numbers from official website of lottery.
Website allows search previous lottery games by its date.
I have tried it by using requests
module but after request was sent I still receiving website output before submit.
Could take a look and guide me what I am doing wrong?
import requests
import datetime
web_page = 'https://www.lotto.pl/lotto/wyniki-i-wygrane/wyszukaj'
def import_lotto():
date = datetime.datetime(2019, 3, 2).strftime('%Y-%m-%d')
payload = {
'data_losowania[date]': date,
'id': 'wyszukaj-wyniki-submit'
}
response = requests.post(web_page, data=payload)
with open("requests_results.html", 'w') as f:
f.write(response.text)
if __name__ == '__main__':
import_lotto()