路虽远 行则将至

Lee


  • 主页
  • 归档
  • 分类
  • 标签
  •   

站点访客数   人

站点浏览量   次

本页浏览量   次

© 2024 辣辣辣白菜

Theme Typography by Makito

Proudly published with Hexo

Python爬虫学习 - 代理

Posted at 2021-07-02 学习笔记  Python 

实例

如下,就是一个采用代理访问百度首页的例子。

import requests
url = "https://www.baidu.com"
proxies = {
    "https" : "120.78.240.243:3228" #url为https则使用https
}
resp = requests.get(url, proxies=proxies)
resp.encoding = "utf-8"
print(resp.text)

应用场景

需要高并发地请求一个地址时,防止被服务器端发现流量异常而封禁 ip。

공유하기 

 이전 포스트: frps启动后无法连接,telnet提示No route to host 다음 포스트: Python - OpenCV入门 

站点访客数   人

站点浏览量   次

本页浏览量   次

© 2024 辣辣辣白菜

Theme Typography by Makito

Proudly published with Hexo