Answer the question
In order to leave comments, you need to log in
Why can't work with while?
I welcome everyone.
There is this code:
def account_worker(auth_data):
response = 0
session = requests.session()
auth_link = 'some.site.ru'
user_agent = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/93.0.4577.82
Safari/537.36'
headers = {
'Accept': '*/*',
'Accept-Encoding': 'gzip, deflate, br',
'Accept-language': 'ru-RU,ru;q=0.9,en-US;q=0.8,en;q=0.7',
'Content-Type': 'application/x-www-form-urlencoded',
'Referer': 'some.site.ru',
'sec-fetch-mode': 'navigate',
'origin': 'some.site.ru',
'sec-ch-ua': '"Google Chrome";v="93", " Not;A Brand";v="99", "Chromium";v="93"',
'host': 'some.site.ru',
'sec-ch-ua-platform': '"Windows"',
'user-agent': user_agent,
'sec-fetch-site': 'same-origin',
'sec-fetch-site': 'same-origin',
'sec-ch-ua-mobile': '?0',
'sec-fetch-user': '?1',
'upgrade-insecure-requests': '1',
'sec-fetch-dest': 'document'
}
data = auth_data
while response != 200:
response = session.post(auth_link, data=data, headers=headers)
print(response)
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