feat(main): 修改替换 html 标签逻辑
修改替换 html 标签逻辑 Signed-off-by: Ching <loooching@gmail.com>
This commit is contained in:
parent
e7b049a4d0
commit
ef2ac8777b
4
main.py
4
main.py
@ -4,6 +4,7 @@ from selenium import webdriver
|
|||||||
from selenium.webdriver.common.by import By
|
from selenium.webdriver.common.by import By
|
||||||
from selenium.webdriver.chrome.options import Options
|
from selenium.webdriver.chrome.options import Options
|
||||||
import time
|
import time
|
||||||
|
import re
|
||||||
|
|
||||||
|
|
||||||
def post_fanfou(webdrive_, fanfou_status, images=None):
|
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]
|
posted_ids = [x.strip() for x in posted_ids]
|
||||||
print(posted_ids)
|
print(posted_ids)
|
||||||
if str(min_id) not in 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)
|
post_fanfou(chrome, content, None)
|
||||||
# write to file
|
# write to file
|
||||||
with open('last_id.txt', 'a') as f:
|
with open('last_id.txt', 'a') as f:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user