吾爱破解 - LCG - LSG |安卓破解|病毒分析|www.52pojie.cn

 找回密码
 注册[Register]

QQ登录

只需一步,快速开始

查看: 712|回复: 5
收起左侧

[求助] 关于IP daili池的问题?

[复制链接]
double07 发表于 2021-12-31 21:28
本帖最后由 double07 于 2021-12-31 23:02 编辑

用proxy_pool-master白嫖免费ip,获取IP后,爬数据还是出现网站“人机认证”的提示,说明ip池ip没挂上。现在没弄清楚到底是白嫖的ip时效性太短,还是在调用ip池代码写得不对?
[Python] 纯文本查看 复制代码
# 获取网页内容[/b][/size]
# =========================================================================调用代{过}{滤}理API
def get_proxy():
    return requests.get("http://127.0.0.1:5010/get/").json()

def delete_proxy(proxy):
    requests.get("http://127.0.0.1:5010/delete/?proxy={}".format(proxy))
# =========================================================================调用代{过}{滤}理API

def gethtml(url):
    retry_count = 4
    proxy = get_proxy().get("proxy")
    while retry_count > 0:
        try:
            response = requests.get(url, cookies=cookies, proxies={"http": "http://{}".format(proxy)})
            encodingInfo = chardet.detect(response.content)
            r_response = response.content.decode(encodingInfo['encoding'], 'ignore')
            return r_response
        except Exception:
            retry_count -= 1
            delete_proxy(proxy)
    return None



# 主程序
if __name__ == '__main__':
    u = 'https://cq.ke.com/ershoufang/'
    html = gethtml(u)
    html_1 = etree.HTML(html)
    href_1 = html_1.xpath(
        '//*[@id="beike"]/div[1]/div[3]/div[1]/dl[2]/dd/div[1]/div[1]/a/@href') 
    pool = mp.Pool(7)
    crawl = []
    for i in tqdm(href_1, desc='子区域下载进度'):
        crawl.append(pool.apply_async(get_suburl, args=(i,)))






发帖前要善用论坛搜索功能,那里可能会有你要找的答案或者已经有人发布过相同内容了,请勿重复发帖。

tmp 发表于 2021-12-31 21:38
你有没有想过别人也在干这事

免费评分

参与人数 1热心值 +1 收起 理由
lizf2019 + 1 不愧是你

查看全部评分

2513002960 发表于 2021-12-31 21:57
也有可能是你请求头不完整,没有通过后台的校验
 楼主| double07 发表于 2021-12-31 22:06
tmp 发表于 2021-12-31 21:38
你有没有想过别人也在干这事

各路大神,有好路子没有,付费的也行
幽溪左畔 发表于 2021-12-31 22:29
有的网站会检测是否是代{过}{滤}理IP 免费的不会太好用的
ibook 发表于 2022-1-1 01:00
可能是万人骑的ip 都烂了
您需要登录后才可以回帖 登录 | 注册[Register]

本版积分规则 警告:本版块禁止回复与主题无关非技术内容,违者重罚!

快速回复 收藏帖子 返回列表 搜索

RSS订阅|小黑屋|处罚记录|联系我们|吾爱破解 - LCG - LSG ( 京ICP备16042023号 | 京公网安备 11010502030087号 )

GMT+8, 2024-5-27 11:17

Powered by Discuz!

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表