Coder Social home page Coder Social logo

zhihu-go's People

Contributors

deanthompson avatar yinheli avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

zhihu-go's Issues

doc.Find("div#zh-question-detail") result is empty

the doc.Find("div#zh-question-detail") result is empty which due to the zhihu's front page changed, so how the "div#zh-question-detail" comes,why i didn't find the zh-question-detail div in the front page,and i didn't find the similar div name

bug: 收藏夹的正则匹配不完善, 未匹配私有收藏夹

出错问题代码定位:

  • /src/github.com/DeanThompson/zhihu-go/util.go:27
reCollectionURL  = regexp.MustCompile("^(http|https)://www.zhihu.com/collection/[0-9]{8}$")
  • 私有收藏夹是9位, 不是8位.
  • 报错日志:
URL:  https://www.zhihu.com/collection/39752212
URL:  https://www.zhihu.com/collection/19701180
URL:  https://www.zhihu.com/collection/20067792
URL:  https://www.zhihu.com/collection/74578659
URL:  https://www.zhihu.com/collection/123760119    # 此为私有收藏夹

panic: 收藏夹链接不正确:https://www.zhihu.com/collection/123760119

  • 个人感觉没必要对位数作正则, URL 前缀已经标识类型了.

image

解决:

  • 建议去掉位数匹配.

运行 example.go 报错

新建了 config.json,增加了登陆信息,运行时,输出了登陆成功,但没有成功执行。报错信息:

NFO: GET https://www.zhihu.com/settings/profile
INFO: 获取 profile 的请求,跳转到了:https://www.zhihu.com/?next=%2Fsettings%2Fprofile
INFO: 登录类型:email, 登录地址:https://www.zhihu.com/login/email
INFO: GET https://www.zhihu.com
INFO: 获取验证码:https://www.zhihu.com/captcha.gif?r=1482506116000&type=login
INFO: GET https://www.zhihu.com/captcha.gif?r=1482506116000&type=login
INFO: 调用外部程序渲染验证码……
INFO: Command: open /Users/Frank/src/github.com/DeanThompson/zhihu-go/examples/verify.gif
请输入验证码:vuyx
INFO: 登录中,用户名:**********@hotmail.com
INFO: 登录响应内容:{"r":0, "msg": "\u767b\u5f55\u6210\u529f"}
SUCCESS: 登录成功!
INFO: User fields:
INFO:   is anonymous: false
INFO: GET https://www.zhihu.com/people/jixin
INFO:   userId:
panic: interface conversion: interface is nil, not string

goroutine 1 [running]:
panic(0x2a5f00, 0xc4202a5400)
        /usr/local/go/src/runtime/panic.go:500 +0x1a1
github.com/DeanThompson/zhihu-go.(*User).GetDataID(0xc4203edc20, 0x2f7589, 0xb)
        /Users/myname/src/github.com/DeanThompson/zhihu-go/user.go:85 +0x3db
main.showUser(0xc4203edc20)
        /Users/myname/src/github.com/DeanThompson/zhihu-go/examples/example.go:164 +0x231
main.main()
        /Users/myname/src/github.com/DeanThompson/zhihu-go/examples/example.go:19 +0x81
exit status 2

golang 版本:
go version go1.7.3 darwin/amd64

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.