Comments (6)
从改了参数传递似乎有了一个小bug。
image,这个bug的意思是如有两个关键词,似乎不能爬完第一个关键词(两年的关键词爬了10个月后)就开始爬下一个关键词了,下一个关键词爬了10月,又返回第一个开始爬,我记得以前是爬完一个之后才开始爬另一个。不知道为什么会出现这样的情况。
from spider-baiduindex.
请问这句# _all_kind = ['all', 'pc', 'wise']里面的'all', 'pc', 'wise'分别是什么含义呢
百度指数里面可以选择PC端数据、移动端数据和PC加移动端数据,如果想爬移动端数据或PC加移动端数据应该怎么改代码呀
from spider-baiduindex.
请问这句# _all_kind = ['all', 'pc', 'wise']里面的'all', 'pc', 'wise'分别是什么含义呢
百度指数里面可以选择PC端数据、移动端数据和PC加移动端数据,如果想爬移动端数据或PC加移动端数据应该怎么改代码呀
百度搜索指数,返回数据有keyword(关键词), type(指数类型,wise:移动端,pc:PC端,all:全部), date(日期), index(指数)。在你自己的程序使用type去过滤你想要的类型就可以。不需要改动爬虫程序本身的逻辑。
from spider-baiduindex.
请问这句# _all_kind = ['all', 'pc', 'wise']里面的'all', 'pc', 'wise'分别是什么含义呢
百度指数里面可以选择PC端数据、移动端数据和PC加移动端数据,如果想爬移动端数据或PC加移动端数据应该怎么改代码呀百度搜索指数,返回数据有keyword(关键词), type(指数类型,wise:移动端,pc:PC端,all:全部), date(日期), index(指数)。在你自己的程序使用type去过滤你想要的类型就可以。不需要改动爬虫程序本身的逻辑。
谢谢解答。我按照这个方法加了type功能,但是不知道哪里有问题报错了,可以帮忙看一下吗
cookie设置好了,run的是以下代码
keywords = ['许佳琪'] baidu_index = BaiduIndex( keywords=keywords, start_date='2020-03-10', end_date='2020-10-9', type='all', cookies=cookies, ) for index in baidu_index.get_index(): print(index)
运行后报错如下
`Traceback (most recent call last):
File "E:/爬百度词频/爬百度指数.py", line 19, in
for index in baidu_index.get_index():
File "E:\爬百度词频\baidu_index\baidu_index.py", line 62, in get_index
key, encrypt_data[kind]['data'])
KeyError: 'a'
Process finished with exit code 1`
from spider-baiduindex.
请问这句# _all_kind = ['all', 'pc', 'wise']里面的'all', 'pc', 'wise'分别是什么含义呢
百度指数里面可以选择PC端数据、移动端数据和PC加移动端数据,如果想爬移动端数据或PC加移动端数据应该怎么改代码呀百度搜索指数,返回数据有keyword(关键词), type(指数类型,wise:移动端,pc:PC端,all:全部), date(日期), index(指数)。在你自己的程序使用type去过滤你想要的类型就可以。不需要改动爬虫程序本身的逻辑。
谢谢解答。我按照这个方法加了type功能,但是不知道哪里有问题报错了,可以帮忙看一下吗
cookie设置好了,run的是以下代码
keywords = ['许佳琪'] baidu_index = BaiduIndex( keywords=keywords, start_date='2020-03-10', end_date='2020-10-9', type='all', cookies=cookies, ) for index in baidu_index.get_index(): print(index)
运行后报错如下
`Traceback (most recent call last):
File "E:/爬百度词频/爬百度指数.py", line 19, in
for index in baidu_index.get_index():
File "E:\爬百度词频\baidu_index\baidu_index.py", line 62, in get_index
key, encrypt_data[kind]['data'])
KeyError: 'a'Process finished with exit code 1`
- 你可以下载最新版的爬虫程序
- 你可以不传type,或者传入
['all']
from spider-baiduindex.
请问这句# _all_kind = ['all', 'pc', 'wise']里面的'all', 'pc', 'wise'分别是什么含义呢
百度指数里面可以选择PC端数据、移动端数据和PC加移动端数据,如果想爬移动端数据或PC加移动端数据应该怎么改代码呀百度搜索指数,返回数据有keyword(关键词), type(指数类型,wise:移动端,pc:PC端,all:全部), date(日期), index(指数)。在你自己的程序使用type去过滤你想要的类型就可以。不需要改动爬虫程序本身的逻辑。
谢谢解答。我按照这个方法加了type功能,但是不知道哪里有问题报错了,可以帮忙看一下吗
cookie设置好了,run的是以下代码
keywords = ['许佳琪'] baidu_index = BaiduIndex( keywords=keywords, start_date='2020-03-10', end_date='2020-10-9', type='all', cookies=cookies, ) for index in baidu_index.get_index(): print(index)
运行后报错如下
Traceback (most recent call last): File "E:/爬百度词频/爬百度指数.py", line 19, in for index in baidu_index.get_index(): File "E:\爬百度词频\baidu_index\baidu_index.py", line 62, in get_index key, encrypt_data[kind]['data']) KeyError: 'a' Process finished with exit code 1
1. 你可以下载最新版的爬虫程序 2. 你可以不传type,或者传入`['all']`
我知道报错原因了,加了type功能以后,给type赋值时应该用type=['all']
而不是type='all'
from spider-baiduindex.
Related Issues (20)
- BaiduIndex.get_index()报错 HOT 1
- 用老代码,突然指数变为:暂无数据 HOT 11
- 每次只能搜索五个关键词吗?能否扩充呢? HOT 8
- 存储到本地 HOT 1
- 【教程】|百度搜索指数例子中的时间间隔为1天,如何将时间间隔改为半年或一年?
- 【教程】我似乎发现一个bug,爬虫时长跨度超过300天,在300天这点重复该关键词查询602次
- Bad Request HOT 5
- 通过手机扫码登陆,扫描到的一瞬间程序报错QdataError: 百度登录失败 HOT 1
- 提供查询周、月、年平均百度指数的尝试。 HOT 1
- 关于 'ERROR-10003: 网络错误' 建议 HOT 2
- 百度品牌指数和品牌搜索指数 HOT 2
- 账号限制查询 HOT 2
- 百度指数填入cookie后仍提示cookie失效
- 或许可以考虑做一个识别cookies是否有效机制?
- 百度的搜索好像不太好用了 HOT 3
- 账号登录是不是要去解析他的js对密码的加密? HOT 1
- 登录获取dbuss的时候返回channel_v中发现可能没有指定内容,从而报错,建议增加循环获取 HOT 1
- 获取uniqid的时候报错
- 如何获取2010年之前的数据 HOT 1
- 爬了几次,现在出现了安全验证,这个怎么搞呀? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from spider-baiduindex.