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

运行提示cookie.py中67行中的全局变量json没有初始化 #79

Open
dadahua555 opened this issue Jan 20, 2019 · 0 comments
Open

Comments

@dadahua555
Copy link

2019-01-20 16:09:04 [twisted] CRITICAL:
Traceback (most recent call last):
File "/usr/lib64/python2.7/site-packages/twisted/internet/defer.py", line 1418, in _inlineCallbacks
result = g.send(result)
File "/usr/lib64/python2.7/site-packages/scrapy/crawler.py", line 98, in crawl
six.reraise(*exc_info)
File "/usr/lib64/python2.7/site-packages/scrapy/crawler.py", line 80, in crawl
self.engine = self._create_engine()
File "/usr/lib64/python2.7/site-packages/scrapy/crawler.py", line 105, in _create_engine
return ExecutionEngine(self, lambda _: self.stop())
File "/usr/lib64/python2.7/site-packages/scrapy/core/engine.py", line 69, in init
self.downloader = downloader_cls(crawler)
File "/usr/lib64/python2.7/site-packages/scrapy/core/downloader/init.py", line 88, in init
self.middleware = DownloaderMiddlewareManager.from_crawler(crawler)
File "/usr/lib64/python2.7/site-packages/scrapy/middleware.py", line 58, in from_crawler
return cls.from_settings(crawler.settings, crawler)
File "/usr/lib64/python2.7/site-packages/scrapy/middleware.py", line 34, in from_settings
mwcls = load_object(clspath)
File "/usr/lib64/python2.7/site-packages/scrapy/utils/misc.py", line 44, in load_object
mod = import_module(module)
File "/usr/lib64/python2.7/importlib/init.py", line 37, in import_module
import(name)
File "/home/bc/github_spider/SinaSpider/Sina_spider1/Sina_spider1/middleware.py", line 3, in
from cookies import cookies
File "/home/bc/github_spider/SinaSpider/Sina_spider1/Sina_spider1/cookies.py", line 151, in
cookies = getCookies(myWeiBo)
File "/home/bc/github_spider/SinaSpider/Sina_spider1/Sina_spider1/cookies.py", line 144, in getCookies
cookie = getCookie(account, password)
File "/home/bc/github_spider/SinaSpider/Sina_spider1/Sina_spider1/cookies.py", line 36, in getCookie
return get_cookie_from_login_sina_com_cn(account, password)
File "/home/bc/github_spider/SinaSpider/Sina_spider1/Sina_spider1/cookies.py", line 67, in get_cookie_from_login_sina_com_cn
info = json.loads(jsonStr)
NameError: global name 'json' is not defined
求解...

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

1 participant