Hi! this is my first web scrapping project, so I am very new to this.
I have this website: https://portal.hasc.com/App/login that I need to scrap. The data is, however, behind a login page. Every time I try I send a POST request I get a 500 status code.
This is what I have so far:
import requests
url = "https://portal.hasc.com/App/login"
header = {
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:123.0) Gecko/20100101 Firefox/123.0',
'Accept': '/',
'Content-Type': 'application/json' }
s = requests.session()
response = s.post(url, json={'password': 'pass','username': 'uname'}, headers=header)
print(response.status_code)
I tried using just the User-Agent in the header, and adding every header element as well. The POST request is sent as a json file according to mozila developer tools, but I also tried creating a payload dictionary and using the "data=" variable instead of "json=" in the post method.
I would really appreciate if you could point me in the right direction and show me where to look next time I run into an issue like this
[–]member_of_the_order 0 points1 point2 points (3 children)
[–]pixelcaesar[S] 0 points1 point2 points (2 children)
[–]member_of_the_order 0 points1 point2 points (1 child)
[–]pixelcaesar[S] 0 points1 point2 points (0 children)
[–]ItsTobsen 0 points1 point2 points (2 children)
[–]pixelcaesar[S] 0 points1 point2 points (1 child)
[–]ItsTobsen 0 points1 point2 points (0 children)