Code Monkey home page Code Monkey logo

Comments (9)

dataabc avatar dataabc commented on May 22, 2024

可以用,出现上述错误说明cookie没有正确获取,按照README方法获取cookie就可以了

from weibospider.

matakk avatar matakk commented on May 22, 2024

谢谢,可以下载了,我加入了随机sleep,后来出现了错误,我恢复了原版,但是反复实验几次后,可以获取到用户名,但是后面的内容失败了,您见过这个错误吗?

X:\v\weibo\weibospider\weiboSpider-master>"F:\DevTools\python\Anaconda2\python.e
xe" weiboSpider.py
Error: None
Traceback (most recent call last):
File "weiboSpider.py", line 40, in get_username
selector = etree.HTML(html)
File "src\lxml\lxml.etree.pyx", line 3161, in lxml.etree.HTML (src\lxml\lxml.e
tree.c:76137)
File "src\lxml\parser.pxi", line 1830, in lxml.etree._parseMemoryDocument (src
\lxml\lxml.etree.c:115101)
File "src\lxml\parser.pxi", line 1718, in lxml.etree._parseDoc (src\lxml\lxml.
etree.c:113781)
File "src\lxml\parser.pxi", line 1090, in lxml.etree._BaseParser._parseDoc (sr
c\lxml\lxml.etree.c:108226)
File "src\lxml\parser.pxi", line 584, in lxml.etree._ParserContext._handlePars
eResultDoc (src\lxml\lxml.etree.c:102150)
File "src\lxml\parser.pxi", line 694, in lxml.etree._handleParseResult (src\lx
ml\lxml.etree.c:103800)
File "src\lxml\parser.pxi", line 635, in lxml.etree._raiseParseError (src\lxml
\lxml.etree.c:102946)
XMLSyntaxError: None
Error: None
Traceback (most recent call last):
File "weiboSpider.py", line 54, in get_user_info
selector = etree.HTML(html)
File "src\lxml\lxml.etree.pyx", line 3161, in lxml.etree.HTML (src\lxml\lxml.e
tree.c:76137)
File "src\lxml\parser.pxi", line 1830, in lxml.etree._parseMemoryDocument (src
\lxml\lxml.etree.c:115101)
File "src\lxml\parser.pxi", line 1718, in lxml.etree._parseDoc (src\lxml\lxml.
etree.c:113781)
File "src\lxml\parser.pxi", line 1090, in lxml.etree._BaseParser._parseDoc (sr
c\lxml\lxml.etree.c:108226)
File "src\lxml\parser.pxi", line 584, in lxml.etree._ParserContext._handlePars
eResultDoc (src\lxml\lxml.etree.c:102150)
File "src\lxml\parser.pxi", line 694, in lxml.etree._handleParseResult (src\lx
ml\lxml.etree.c:103800)
File "src\lxml\parser.pxi", line 635, in lxml.etree._raiseParseError (src\lxml
\lxml.etree.c:102946)
XMLSyntaxError: None
Error: None

from weibospider.

matakk avatar matakk commented on May 22, 2024

今天测试了一下又可以了,估计是我测试太频繁了?
我也加入了随机的sleep,测试中。

from weibospider.

softrime avatar softrime commented on May 22, 2024

谢谢,可以下载了,我加入了随机sleep,后来出现了错误,我恢复了原版,但是反复实验几次后,可以获取到用户名,但是后面的内容失败了,您见过这个错误吗?

X:\v\weibo\weibospider\weiboSpider-master>"F:\DevTools\python\Anaconda2\python.e
xe" weiboSpider.py
Error: None
Traceback (most recent call last):
File "weiboSpider.py", line 40, in get_username
selector = etree.HTML(html)
File "src\lxml\lxml.etree.pyx", line 3161, in lxml.etree.HTML (src\lxml\lxml.e
tree.c:76137)
File "src\lxml\parser.pxi", line 1830, in lxml.etree._parseMemoryDocument (src
\lxml\lxml.etree.c:115101)
File "src\lxml\parser.pxi", line 1718, in lxml.etree._parseDoc (src\lxml\lxml.
etree.c:113781)
File "src\lxml\parser.pxi", line 1090, in lxml.etree._BaseParser._parseDoc (sr
c\lxml\lxml.etree.c:108226)
File "src\lxml\parser.pxi", line 584, in lxml.etree._ParserContext._handlePars
eResultDoc (src\lxml\lxml.etree.c:102150)
File "src\lxml\parser.pxi", line 694, in lxml.etree._handleParseResult (src\lx
ml\lxml.etree.c:103800)
File "src\lxml\parser.pxi", line 635, in lxml.etree._raiseParseError (src\lxml
\lxml.etree.c:102946)
XMLSyntaxError: None
Error: None
Traceback (most recent call last):
File "weiboSpider.py", line 54, in get_user_info
selector = etree.HTML(html)
File "src\lxml\lxml.etree.pyx", line 3161, in lxml.etree.HTML (src\lxml\lxml.e
tree.c:76137)
File "src\lxml\parser.pxi", line 1830, in lxml.etree._parseMemoryDocument (src
\lxml\lxml.etree.c:115101)
File "src\lxml\parser.pxi", line 1718, in lxml.etree._parseDoc (src\lxml\lxml.
etree.c:113781)
File "src\lxml\parser.pxi", line 1090, in lxml.etree._BaseParser._parseDoc (sr
c\lxml\lxml.etree.c:108226)
File "src\lxml\parser.pxi", line 584, in lxml.etree._ParserContext._handlePars
eResultDoc (src\lxml\lxml.etree.c:102150)
File "src\lxml\parser.pxi", line 694, in lxml.etree._handleParseResult (src\lx
ml\lxml.etree.c:103800)
File "src\lxml\parser.pxi", line 635, in lxml.etree._raiseParseError (src\lxml
\lxml.etree.c:102946)
XMLSyntaxError: None
Error: None

我也遇到了和你相同的问题,但是我是按照README的方式获取cookie的,你当时是怎么解决的呢

from weibospider.

softrime avatar softrime commented on May 22, 2024

我的问题已经解决了,我是在https://weibo.cn/这里面获取的cookie可以通过登录,但是README里面的cookie不行,供参考

from weibospider.

pingshuaicao avatar pingshuaicao commented on May 22, 2024

我的问题已经解决了,我是在https://weibo.cn/这里面获取的cookie可以通过登录,但是README里面的cookie不行,供参考

是的,我有同样的问题。需要去https://weibo.cn/获取cookie。

from weibospider.

V-know avatar V-know commented on May 22, 2024

2018年12月10号,亲测依然可用!

from weibospider.

zwz453058816 avatar zwz453058816 commented on May 22, 2024

请问您用的编译器是什么,我用IDLE显示invalid syntax error,不知道怎么回事,谢谢。

from weibospider.

dataabc avatar dataabc commented on May 22, 2024

@zwz453058816 说明有语法错误,修改错误行的语法即可,具体哪一行应该有提示

from weibospider.

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.