Commit 9fdf4c7a authored by litaolemo's avatar litaolemo

update

parent abb43d9f
...@@ -42,6 +42,9 @@ class Crawler_zhihu(): ...@@ -42,6 +42,9 @@ class Crawler_zhihu():
def __init__(self, timeout=5,): def __init__(self, timeout=5,):
print(execjs.get().name) print(execjs.get().name)
os.environ["EXECJS_RUNTIME"] = 'Node'
print(execjs.get().name)
self.platform = "zhihu" self.platform = "zhihu"
self.timeout = timeout self.timeout = timeout
self.session = requests.Session() self.session = requests.Session()
...@@ -57,7 +60,7 @@ class Crawler_zhihu(): ...@@ -57,7 +60,7 @@ class Crawler_zhihu():
except: except:
with open('/srv/apps/crawler/crawler_sys/site_crawler/zhihu.js', 'r', encoding='utf-8') as f: with open('/srv/apps/crawler/crawler_sys/site_crawler/zhihu.js', 'r', encoding='utf-8') as f:
js = f.read() js = f.read()
print(js) # print(js)
self.exec_js = execjs.compile(js) self.exec_js = execjs.compile(js)
for popk in pop_key_Lst: for popk in pop_key_Lst:
self.video_data.pop(popk) self.video_data.pop(popk)
...@@ -416,7 +419,7 @@ if __name__ == '__main__': ...@@ -416,7 +419,7 @@ if __name__ == '__main__':
zhihu = Crawler_zhihu() zhihu = Crawler_zhihu()
import os import os
# print(execjs.get().name ) # print(execjs.get().name)
# os.environ["EXECJS_RUNTIME"] = 'Node' # os.environ["EXECJS_RUNTIME"] = 'Node'
# print(execjs.get().name ) # print(execjs.get().name )
# zhihu.get_serach_page_cookies("热玛吉") # zhihu.get_serach_page_cookies("热玛吉")
......
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