Commit 2838ff4e authored by litaolemo's avatar litaolemo

update

parent 9f62ee57
...@@ -144,8 +144,7 @@ class CrawlerDouban(): ...@@ -144,8 +144,7 @@ class CrawlerDouban():
else: else:
get_page = retry_get_url(url, headers=self.headers, timeout=self.timeout) get_page = retry_get_url(url, headers=self.headers, timeout=self.timeout)
except: except:
get_page = None continue
has_more = False
if get_page and get_page.status_code == 200: if get_page and get_page.status_code == 200:
try: try:
page_json = get_page.json() page_json = get_page.json()
...@@ -157,8 +156,10 @@ class CrawlerDouban(): ...@@ -157,8 +156,10 @@ class CrawlerDouban():
except Exception as e: except Exception as e:
print("load data error %s" % e) print("load data error %s" % e)
continue continue
if page_dic: if page_dic:
for one in page_dic: for one in page_dic:
try:
releaser_id = one["author"]["id"] releaser_id = one["author"]["id"]
mid = one["id"] mid = one["id"]
if True: if True:
...@@ -186,6 +187,8 @@ class CrawlerDouban(): ...@@ -186,6 +187,8 @@ class CrawlerDouban():
# print(res_dic) # print(res_dic)
yield res_dic yield res_dic
except Exception as e:
print("single data parse error %s " %e)
# except Exception as e: # except Exception as e:
# print(one) # print(one)
# print("row formate error %s" % e) # print("row formate error %s" % e)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment