GithubHelp home page GithubHelp logo

Comments (6)

huangzhaor avatar huangzhaor commented on June 12, 2024

从改了参数传递似乎有了一个小bug。
image,这个bug的意思是如有两个关键词,似乎不能爬完第一个关键词(两年的关键词爬了10个月后)就开始爬下一个关键词了,下一个关键词爬了10月,又返回第一个开始爬,我记得以前是爬完一个之后才开始爬另一个。不知道为什么会出现这样的情况。

from spider-baiduindex.

DF-18 avatar DF-18 commented on June 12, 2024

请问这句# _all_kind = ['all', 'pc', 'wise']里面的'all', 'pc', 'wise'分别是什么含义呢
百度指数里面可以选择PC端数据、移动端数据和PC加移动端数据,如果想爬移动端数据或PC加移动端数据应该怎么改代码呀

from spider-baiduindex.

longxiaofei avatar longxiaofei commented on June 12, 2024

请问这句# _all_kind = ['all', 'pc', 'wise']里面的'all', 'pc', 'wise'分别是什么含义呢
百度指数里面可以选择PC端数据、移动端数据和PC加移动端数据,如果想爬移动端数据或PC加移动端数据应该怎么改代码呀

百度搜索指数,返回数据有keyword(关键词), type(指数类型,wise:移动端,pc:PC端,all:全部), date(日期), index(指数)。在你自己的程序使用type去过滤你想要的类型就可以。不需要改动爬虫程序本身的逻辑。

from spider-baiduindex.

DF-18 avatar DF-18 commented on June 12, 2024

请问这句# _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.

longxiaofei avatar longxiaofei commented on June 12, 2024

请问这句# _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']

from spider-baiduindex.

DF-18 avatar DF-18 commented on June 12, 2024

请问这句# _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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.