-
Notifications
You must be signed in to change notification settings - Fork 995
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
getproxies.py 这个文件是不是增加代理的? #24
Comments
@yijingping 感谢! |
@yijingping 关于下载等待的问题。我在v2ex找到之前您之前的回复,
|
@vipwpcom 对的。在vps上安装拨号精灵,然后部署 |
@yijingping 我在这里发现一个项目感觉挺好,自动采集网络上的代理ip 高匿ip可用性还是比较高的 |
@vipwpcom 不打算这么做。 现在的网络代理基本上已经被人爬了N多次了,即使付费,都没有什么好的代理ip。 建议的方案是:如果发现被封,就重新拨号。 这是更靠谱的方式。 |
@yijingping 你的微信多少,能否加一下,几个问题请教你一下,谢谢 |
jingpingyi |
如果使用vps是不是爬虫项目都要放到那台vps上面?如果我爬虫部署在本地,这种应该怎么部署?直接将vps的ip地址和端口手动添加吗? |
@banqinghong vps如果只做代理的话,需要在vps打开代理服务,并在vps上 执行 |
def get_proxies(self):
# 快代理
#url = 'http://dev.kuaidaili.com/api/getproxy/?orderid=955742122799513&num=100&area=%E5%A4%A7%E9%99%86&b_pcchrome=1&b_pcie=1&b_pcff=1&protocol=1&method=2&an_ha=1&sp1=1&sep=1'
# 代理666
#url = 'http://qsdrk.daili666api.com/ip/?tid=559017461234554&num=100&delay=3&category=2&sortby=time&foreign=none&filter=on'
url = 'http://qsdrk.daili666api.com/ip/?tid=555451817416492&num=100&delay=3&category=2&sortby=time&foreign=none&filter=on'
r = requests.get(url)
lines = r.text.split()
for line in lines:
logger.debug(line)
try:
host, port = line.split(':')
Proxy.objects.get_or_create(host=host, port=int(port))
except Exception as e:
print e
The text was updated successfully, but these errors were encountered: