1 import requests
 2 
 3 proxies={
 4     'http':'http://192.168.1.1:88'
 5     'https':'https://192.168.1.1:88'
 6 #如果代理ip需要用户名和密码的话 'http':'user:password@192.168.1.1:88'
 7 }
 8 response = requests.get(url,proxies=proxies)
 9 print(response.status_code)
10 
11 #如果代理类型不是http或者https,而是socks代理
12 #需要先 pip3 install 'requests[socks]
13 proxies={
14     'http':'socks5://192.168.1.1:88'
15     'https':'socks5://192.168.1.1:88'
16 #如果代理ip需要用户名和密码的话 'http':'user:password@192.168.1.1:88'
17 }

 

相关文章:

  • 2021-07-09
  • 2022-02-27
  • 2021-07-29
  • 2021-10-04
  • 2022-12-23
  • 2021-11-20
  • 2022-12-23
  • 2021-11-23
猜你喜欢
  • 2022-12-23
  • 2021-09-18
  • 2021-11-03
  • 2021-04-23
  • 2021-09-13
  • 2021-08-11
  • 2021-12-19
相关资源
相似解决方案