I need to login into [a website] and use the session to scrape some data. However when using POST, I always get status 404.
Here is what I have already tried:
import requests
PW="password"
UN="username"
payload={"Login":UN,"Password":PW,"submit":"Kirjaudu+sisään"}
url="[a website]"
s=requests.session()
data=s.post(url,data=payload)
print(data)
The output is:
<Response [404]>
I have also tried supplying a Firefox user agent for the site:
s.post(url,data=payload,headers={"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:66.0) Gecko/20100101 Firefox/66.0"})
It did not make a difference.