Skip to content

Commit

Permalink
修复错误
Browse files Browse the repository at this point in the history
  • Loading branch information
chyroc committed May 12, 2016
1 parent b0cd2c1 commit 9033ed5
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions wechatsogou.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#!/usr/bin/python3
#coding=utf-8
import urllib.request
from lxml import etree
Expand Down Expand Up @@ -40,12 +39,12 @@ def __enter__(self):
cookie = json.load(f)
self.session.cookies.update(cookie)
try:
wechatspider().search_gzh('newsbro')
WechatSpider().search_gzh('newsbro')
except WechatSogouException:
os.remove(self.cookiefile)
self.session = requests.session()
try:
wechatspider().search_gzh('newsbro')
WechatSpider().search_gzh('newsbro')
except WechatSogouException:
raise WechatSogouException('session test error')
return self.session
Expand Down

0 comments on commit 9033ed5

Please sign in to comment.