使用代理

使用代理

为什么爬虫需要使用代理

  1. 让服务器以为不是同-一个客户端在请求
  2. 防止我们的真实地址被泄露,防止被追究

用法: requests.get(url, proxies=proxies)

proxies的形式:字典

proxies = {
    "http": "http://12.34.56.79:9527",
    "https": "http://12.34.56.79:9527"
    }
posted @ 2021-04-29 10:26  廿九九  阅读(140)  评论(0)    收藏  举报