feat(main): 修改替换 html 标签逻辑

修改替换 html 标签逻辑

Signed-off-by: Ching <loooching@gmail.com>
This commit is contained in:
Ching 2022-03-08 11:44:54 +08:00
parent e7b049a4d0
commit ef2ac8777b

View File

@ -4,6 +4,7 @@ from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.chrome.options import Options
import time
import re
def post_fanfou(webdrive_, fanfou_status, images=None):
@ -59,7 +60,8 @@ def run(instance, access_token, fanfou_account, fanfou_password):
posted_ids = [x.strip() for x in posted_ids]
print(posted_ids)
if str(min_id) not in posted_ids:
content = status['content'].replace('<p>', '').replace('</p>', '').replace('<br />', '\n')
content = status['content'].replace('<br />', '\n')
content = re.sub('<.*?>', '', content)
post_fanfou(chrome, content, None)
# write to file
with open('last_id.txt', 'a') as f: