Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
C
crawler
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
backend
crawler
Commits
0b418401
Commit
0b418401
authored
Aug 07, 2020
by
litaolemo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
45055631
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
1 deletion
+3
-1
crawler_zhihu.py
crawler_sys/site_crawler/crawler_zhihu.py
+3
-1
No files found.
crawler_sys/site_crawler/crawler_zhihu.py
View file @
0b418401
...
@@ -40,8 +40,9 @@ from write_data_into_es.func_cal_doc_id import cal_doc_id
...
@@ -40,8 +40,9 @@ from write_data_into_es.func_cal_doc_id import cal_doc_id
class
Crawler_zhihu
():
class
Crawler_zhihu
():
def
__init__
(
self
,
timeout
=
None
,
platform
=
'weibo'
):
def
__init__
(
self
,
timeout
=
5
,
):
self
.
platform
=
"zhihu"
self
.
platform
=
"zhihu"
self
.
timeout
=
timeout
self
.
session
=
requests
.
Session
()
self
.
session
=
requests
.
Session
()
std_fields
=
Std_fields_video
()
std_fields
=
Std_fields_video
()
self
.
video_data
=
std_fields
.
video_data
self
.
video_data
=
std_fields
.
video_data
...
@@ -55,6 +56,7 @@ class Crawler_zhihu():
...
@@ -55,6 +56,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
)
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
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment