1先挂上代理
2获得本机代理端口
C:\Users\Administrator>python
Python 3.8.5 (default, Sep 3 2020, 21:29:08) [MSC v.1916 64 bit (AMD64)] :: Anaconda, Inc. on win32
Warning:
This Python interpreter is in a conda environment, but the environment has
not been activated. Libraries may fail to load. To activate this environment
please see https://conda.io/activation
Type "help", "copyright", "credits" or "license" for more information.
>>> from urllib.request import getproxies
>>> getproxies()
{'https': 'http://127.0.0.1:11000', 'http': 'http://127.0.0.1:11000'}
此处获得代理端口为11000
3创建环境变量
HTTP_PROXY: http://127.0.0.1:11000
HTTPS_PROXY: http://127.0.0.1:11000
image.png
网友评论