Skip to content
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

一次请求只有10条 #3

Open
bravolover520 opened this issue Nov 18, 2016 · 19 comments
Open

一次请求只有10条 #3

bravolover520 opened this issue Nov 18, 2016 · 19 comments

Comments

@bravolover520
Copy link

No description provided.

@baif666
Copy link
Contributor

baif666 commented Dec 10, 2016

再说详细一点?哪部分的问题?

@tss12
Copy link

tss12 commented Dec 10, 2016

@baif666 你这个里面 每次只能抓十个用户的数据,看了下代码,貌似没找着这个十个用户是在哪控制的

@baif666
Copy link
Contributor

baif666 commented Dec 10, 2016

我也不是最初作者,我尽量给你看看吧

@tss12
Copy link

tss12 commented Dec 10, 2016

@baif666 好啊 你帮看看

@baif666
Copy link
Contributor

baif666 commented Dec 11, 2016

理论上最多只出现排名前15的答案

@baif666
Copy link
Contributor

baif666 commented Dec 11, 2016

如果不够的话,应该都会显示,多于15条答案,只显示前15个,不应该只显示10条,你遇到什么情况了?

@baif666
Copy link
Contributor

baif666 commented Dec 12, 2016

@tss12 原作者的方法一次最多爬取10条答案,不知道原作者怎么想的,我也不好改,等原作者出面可能能处理

@tss12
Copy link

tss12 commented Dec 12, 2016 via email

@baif666
Copy link
Contributor

baif666 commented Dec 12, 2016

原来如此

@baif666
Copy link
Contributor

baif666 commented Dec 12, 2016

话说你是怎么知道的啊 @tss12

@tss12
Copy link

tss12 commented Dec 12, 2016 via email

@ladingwu
Copy link
Owner

简书上有人问了同样的问题,在这里,我先提供一个方向,就是每个答案下都有一个“更多”按钮,找到点击更多按钮时,浏览器时如何请求服务器的

我试了下,请求大概是这样:
reqeust: https://www.zhihu.com/node/QuestionAnswerListV2
fromdata: method:next
params:{"url_token":48264708,"pagesize":10,"offset":20}

你们可以试试,有问题可以过来探讨

如果有时间,我会尽快解决,最近有点忙。。

如果你们解决了,欢迎提交给我。。

@ladingwu
Copy link
Owner

@tss12 @baif666

@baif666
Copy link
Contributor

baif666 commented Dec 15, 2016

@ladingwu 没大看懂你写的那段代码是什么意思

@ladingwu
Copy link
Owner

ladingwu commented Dec 16, 2016

@baif666 那是我在浏览器上,点击知乎答案的页面“加载更多” 按钮的时候,浏览器的动作....你可以在电脑上测试下

@baif666
Copy link
Contributor

baif666 commented Dec 16, 2016

咋看到的啊?有什么插件吗?

@ladingwu
Copy link
Owner

ladingwu commented Dec 16, 2016

@baif666 .直接用chrome浏览器,打开开发者调试界面,为了防止知乎自动加载,你把网络关掉试试,就能看到“加载更多”的按钮了,然后点击它,观察浏览器的动作....用python模拟一下试试

@baif666
Copy link
Contributor

baif666 commented Dec 17, 2016

好的,我试试 @ladingwu 我之前都用的火狐

@tss12
Copy link

tss12 commented Sep 8, 2017

@ladingwu 说的没错,Python获取动态加载的数据这块好像主要都是 模拟请求来获得数据,具体实现目前还没尝试过,不知有模拟过的没

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants