We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
目前实现: 抓取代理 检查代理速度 生成可用代理列表
只需要在需要使用代理的爬虫的 yield request的函数前面加上@random_proxy
# 如果需要代理请打开 # @random_proxy def yield_request(self, item, start_date=None, end_date=None): data_path = get_kdata_path(item, source='163') if start_date: start = start_date.strftime('%Y%m%d') else: start = item['listDate'].replace('-', '') if end_date: end = end_date.strftime('%Y%m%d') else: end = datetime.today().strftime('%Y%m%d') if not os.path.exists(data_path) or start_date or end_date: if item['exchange'] == 'sh': exchange_flag = 0 else: exchange_flag = 1 url = self.get_k_data_url(exchange_flag, item['code'], start, end) yield Request(url=url, meta={'path': data_path, 'item': item}, callback=self.download_day_k_data)
经测试,抓取稳定且速度还不错.
大家可以自己去爬一些代理或者手动添加自己买的代理,只要符合以下格式即可:
The text was updated successfully, but these errors were encountered:
No branches or pull requests
目前实现:
抓取代理
检查代理速度
生成可用代理列表
只需要在需要使用代理的爬虫的 yield request的函数前面加上@random_proxy
经测试,抓取稳定且速度还不错.
大家可以自己去爬一些代理或者手动添加自己买的代理,只要符合以下格式即可:
The text was updated successfully, but these errors were encountered: