Answer the question
In order to leave comments, you need to log in
Python requests how to work with proxy correctly?
I am writing a python program that constantly sends requests to a certain website.
r = s.post(URL, data=data, headers=headers, proxies=proxies)
proxies = {
'http': 'xxx.xx.xxx.xx:xxxx'
}
Answer the question
In order to leave comments, you need to log in
First of all:
proxies = {
'http': 'xxx.xx.xxx.xx:xxxx',
'https': 'xxx.xx.xxx.xx:xxxx'
}
proxies = []
for proxy in proxies:
response = requests.get(proxies=proxy)
if response.status_code == requests.codes['ok']:
break
response.text
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question