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
0cc47263
Commit
0cc47263
authored
Jul 30, 2020
by
litaolemo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
b5127f27
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
13 deletions
+13
-13
cal_ni_and_put_to_backend.py
crawler_sys/scheduler/cal_ni_and_put_to_backend.py
+13
-13
No files found.
crawler_sys/scheduler/cal_ni_and_put_to_backend.py
View file @
0cc47263
...
...
@@ -15,7 +15,7 @@ import requests
import
os
import
copy
import
re
import
HTMLParser
#
import HTMLParser
import
pymysql
from
crawler.crawler_sys.utils.output_results
import
retry_get_url
from
lxml
import
html
...
...
@@ -167,18 +167,18 @@ WHITE_TAGS = {
}
def
_get_rich_text
(
rich_text
):
"""
富文本标签转成标签
:param rich_text:
:return:
"""
try
:
h
=
HTMLParser
.
HTMLParser
()
rich_text
=
h
.
unescape
(
rich_text
.
decode
(
"utf-8"
)
.
replace
(
"&"
,
"&"
)
.
replace
(
"
\n
"
,
"<br>"
))
# 富文本标签转成标签对象
return
rich_text
except
:
return
rich_text
#
def _get_rich_text(rich_text):
#
"""
#
富文本标签转成标签
#
:param rich_text:
#
:return:
#
"""
#
try:
#
h = HTMLParser.HTMLParser()
#
rich_text = h.unescape(rich_text.decode("utf-8").replace("&", "&").replace("\n", "<br>")) # 富文本标签转成标签对象
#
return rich_text
#
except:
#
return rich_text
def
gm_convert_html_tags
(
rich_text
,
all_tags
=
False
,
remove_tags
=
None
):
...
...
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