Answer the question
In order to leave comments, you need to log in
How to move on the site in the parser, while remaining logged in?
Hello.
It is necessary to parse the payment history from the site https://global24.ua .
I pass the authorization process successfully, but then I can’t go to the payment history or profile page.
from bs4 import BeautifulSoup as bs
import requests
import ast
session = requests.Session()
payload = {
'loginType': "text",
'login': "LOGIN",
'password':"PASSWORD"
}
head_post = {
'user-agent': 'Mozilla/5.0 (Windows NT 10.0; ) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.116 Safari/537.36',
'x-gm-print':' 68867ecb796a743efe1fff8f3df344f0',
}
session.headers = head_post
post = session.post('https://art.global24.ua/login', json=payload)
soup = bs(post.content, 'html.parser')
text = soup.text
dct_post = ast.literal_eval(text)
keytoken = dct_post['keytoken']
head_get = {
'user-agent': 'Mozilla/5.0 (Windows NT 10.0; ) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.116 Safari/537.36',
'x-gm-print':'68867ecb796a743efe1fff8f3df344f0',
'authorization': keytoken
}
session.headers = head_get
profile = session.get('https://art.global24.ua/profile')
prof = bs(profile.content, 'html.parser')
print(profile)
print(prof.text)
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question