Answer the question
In order to leave comments, you need to log in
How to log in and parse the site?
I want to write my own bot for an electronic journal, but I can't even get past the initial stage (parsing)
I need to enter the site https://riso.sev.gov.ru/authorize and parse the rating page
But here's the catch. After executing the code with authorization, it returns another page to me
. I decided to parse the registration page and the answer is exactly the same as with authorization.
import requests
from bs4 import BeautifulSoup
session = requests.Session()
UserAgent = "Mozilla/5.0 (Windows NT 5.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Safari/537.36"
html = session.get('https://riso.sev.gov.ru/authorize', headers={'User-Agent': UserAgent, 'Upgrade-Insecure-Requests': '1'})
print(html.text)
Answer the question
In order to leave comments, you need to log in
The request was sent incorrectly. Correct option:
data = {'username': (None, 'login'),
'password': (None, 'pass'),
'return_url': (None, '/')}
authorization = session.post('https://riso.sev.gov.ru/ajaxauthorize', files=data)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question