首页 新闻 赞助 找找看

Python如何访问外网?

0
悬赏园豆:30 [待解决问题]

用免费代理ip试了一下,结果报错MaxRetryError("HTTPSConnectionPool……

import requests
proxy = '60.28.38.132:80'
proxies = {
    'http': 'http://' + proxy,
    'https': 'https://' +proxy
}
try:
    res = requests.get('https://www.baidu.com', proxies=proxies)
    print(res.text)
except requests.exceptions.ConnectionError as e:
    print('Error', e.args)

╄冷丶夜♂的主页 ╄冷丶夜♂ | 初学一级 | 园豆:47
提问于:2023-03-05 14:39
< >
分享
所有回答(2)
0

本地使用xx软件就可以连接外网了

ycyzharry | 园豆:25639 (高人七级) | 2023-03-05 19:56
0

github找个代理池,开源的很多

陆无为 | 园豆:68 (初学一级) | 2023-03-16 19:46
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册