Created
June 17, 2022 13:27
-
-
Save yiyuezhuo/3706f6b1941d188adde1fa223cc01338 to your computer and use it in GitHub Desktop.
test proxy
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
proxies = {"http": "http://127.0.0.1:8889", "https": "http://127.0.0.1:8889"} | |
url = "https://www.google.com" | |
%time requests.get(url, proxies=proxies) | |
from multiprocessing.pool import ThreadPool | |
%%time | |
with ThreadPool(5) as p: | |
p.map(lambda x: requests.get(url, proxies=proxies), [0,1,2,3,4]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment