pupilheart

 

 

# IP代理池
def get_proxy():
    \'\'\'
    简答模拟代理池
    返回一个字典类型的键值对,
    \'\'\'
    proxy = ["http://116.211.143.11:80",
             "http://183.1.86.235:8118",
             "http://183.32.88.244:808",
             "http://121.40.42.35:9999",
             "http://222.94.148.210:808"]
    fakepxs = {}
    fakepxs[\'http\'] = proxy[random.randint(0, len(proxy))]
    
    return fakepxs

#使用fake-useragent 模块

# 使用fake-useragent 模块
from fake_useragent import UserAgent
ua = UserAgent()  # 创建 UserAgent的对象
ua.random  # 通过获得随机的 ua

 

分类:

技术点:

相关文章: