空着 IP代理池

 

 

# 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

 

posted @ 2018-12-11 13:29  pupilheart  阅读(158)  评论(0编辑  收藏  举报
点击游惊戏

公告:昔日最爱

数学中国 【python交流群】921487667