纵使杯中|

little小新

园龄:2年6个月粉丝:8关注:0

2024-07-01 22:26阅读: 122评论: 0推荐: 0

11、爬虫-代理

 

"""
通过第三方的ip去请求
"""
import requests
#8.130.39.155:3389
proxies = {
"https":"http://58.20.248.139:9002",
}
headers = {
"User-Agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36",
}
#使用代理去请求
resp = requests.get("http://www.baidu.com",proxies=proxies)
resp.encoding = 'utf-8'
print(resp.text)

本文作者:little小新

本文链接:https://www.cnblogs.com/littlecc/p/17962428

版权声明:本作品采用知识共享署名-非商业性使用-禁止演绎 2.5 中国大陆许可协议进行许可。

posted @   little小新  阅读(122)  评论(0编辑  收藏  举报
点击右上角即可分享
微信分享提示
评论
收藏
关注
推荐
深色
回顶
收起