Answer the question
In order to leave comments, you need to log in
How to use proxy in request if I use it in run_in_executor?
I want to write an asynchronous proxy checker that checks for https proxies.
Tell me how to pass a proxy to the request, code:
def main():
loop = asyncio.get_event_loop()
future1 = loop.run_in_executor(None, requests.get, {'url':'http://www.google.com','proxy': {
'https':'https://login:[email protected]:9122'}})
response1 = yield from future1
print(response1.status_code)
Answer the question
In order to leave comments, you need to log in
The question was stupid (I was drunk), just use requests_html or aiohttp.
aiohttp only supports http proxies, but this is not a problem since for the vast majority of https proxies work in http, if they do not have a block, just send them to the request as regular proxies.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question