Skip to content

Commit

Permalink
issues_feature_post_api_576 实现通过POST方式将数据推送到自定义接口
Browse files Browse the repository at this point in the history
  • Loading branch information
二乔 committed Apr 28, 2024
1 parent 1523bfd commit c0c7525
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion weibo_spider/parser/comment_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def get_long_weibo(self):
# 3. 去掉所有 HTML 标签,但保留标签内的有效文本
new_content = fromstring(html_string).text_content()
# 4. 替换多个连续的 \n 为一个 \n
new_content = re.sub(r'\n+', '\n', new_content)
new_content = re.sub(r'\n+\s*', '\n', new_content)
weibo_content = handle_garbled(new_content)
if weibo_content is not None:
return weibo_content
Expand Down
2 changes: 2 additions & 0 deletions weibo_spider/writer/post_writer.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
import requests

from .writer import Writer
from time import sleep
from requests.exceptions import RequestException

logger = logging.getLogger('spider.post_writer')

Expand Down

0 comments on commit c0c7525

Please sign in to comment.