python的requests爬虫模块使用代理ip方法---集合

形式一

python 复制代码
import requests
proxies = {'http':'128.3.74.224:2890','https':'128.3.74.224:2890'}
ip = requests.get('http://httpbin.org/ip',proxies=proxies)
print(ip.text)

形式二

形式一不行的情况下,试试形式二

python 复制代码
import requests
proxies = {'http':'http://127.0.0.1:7890','https':'https://127.0.0.1:7890'}
ip = requests.get('http://httpbin.org/ip',proxies=proxies)
print(ip.text)

形式三

带有账号密码的使用方法

python 复制代码
import requests
proxies = {'http':'user123:psw123@43.xxx.xxx.113:10801','https':'user123:psw123@43.xxx.xxx.113:10801'}
ip = requests.get('http://httpbin.org/ip',proxies=proxies)
print(ip.text)
相关推荐
毕设源码-郭学长11 分钟前
【开题答辩全过程】以 基于python电商商城系统为例,包含答辩的问题和答案
开发语言·python
black0moonlight12 分钟前
win11 isaacsim 5.1.0 和lab配置
python
散峰而望14 分钟前
【算法竞赛】栈和 stack
开发语言·数据结构·c++·算法·leetcode·github·推荐算法
Mr -老鬼15 分钟前
Rust 的优雅和其他语言的不同之处
java·开发语言·rust
知乎的哥廷根数学学派16 分钟前
基于多尺度注意力机制融合连续小波变换与原型网络的滚动轴承小样本故障诊断方法(Pytorch)
网络·人工智能·pytorch·python·深度学习·算法·机器学习
网安CILLE17 分钟前
PHP四大输出语句
linux·开发语言·python·web安全·网络安全·系统安全·php
jjjddfvv18 分钟前
超级简单启动llamafactory!
windows·python·深度学习·神经网络·微调·audiolm·llamafactory
weixin_5316518119 分钟前
Rust 的所有权机制
java·开发语言·rust
A先生的AI之旅21 分钟前
2025顶会TimeDRT快速解读
人工智能·pytorch·python·深度学习·机器学习
江公望23 分钟前
QT/QML qmlRegisterType()函数浅谈
开发语言·qt