Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
实际上感觉这个好像更适合作为 issue 而非 PR 提出来,⊙﹏⊙b汗
原选择语句为:asks_num = int(soup.find_all("span", class_="num")[0].string)
更改后读取的是同一位置:ask_num = int(soup.find_all('a', href="/people/" +
self.user_id + "/asks").find("span").string)
但可读性更加良好~
对于下面的 get_answer_num 也可以考虑更改~,不通过相对位置来获取 string
最后一个 PR 了
好吧,通读了一早上的源码,自己写了个 fake-zhihu-python 的程序。只有说 orz……
不过 chrome 的开发工具好像对表单的读取不够好,最后在虚拟机里用 fiddler 来抓取解决~
3 个 PR 指向三个部分,看 LZ 怎么选择,希望能多多交流呀