
现在爬个网页太难了。
爬快了被封IP
爬慢了,等得着急
还是用代{过}{滤}理好了,从github上找到了大佬分享的免费代{过}{滤}理,貌似可以用,写了一个小脚本获取。

from multiprocessing.dummy import Lock
import re
import requests
import random
import time
headers={
"User-Agent":'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.77 Safari/537.36 Edg/91.0'
}
#source可以替换,github上有很多
source='https://github.com/roosterkid/openproxylist/blob/main/HTTPS_RAW.txt'
def get_proxies(source_url=source):
print('Try get proxies from:',source_url)
resp=requests.get(source_url,verify=False,headers=headers)
if resp.status_code!=200:
print('Request for source page failed!')
raise Exception('Get pr

本文介绍了如何利用Python从GitHub获取免费的HTTPS代理,并通过编写脚本实现爬虫速度的翻倍。然而,由于网络问题,从GitHub获取代理列表时可能会遇到失败的情况。
最低0.47元/天 解锁文章

被折叠的 条评论
为什么被折叠?



