words in bolden

master
ZouJiu 2023-07-28 20:38:18 +08:00
parent cd65a4ec59
commit 26c892386e
1 changed files with 9 additions and 7 deletions

View File

@ -363,13 +363,15 @@ def recursion(nod, article, number, driver, dircrea, bk=False):
else: else:
article += "["+nod.text+"]"+"("+linksite + ")" article += "["+nod.text+"]"+"("+linksite + ")"
elif tag_name=="b" or tag_name=="strong": elif tag_name=="b" or tag_name=="strong":
p_childNodes = driver.execute_script("return arguments[0].childNodes;", nod) try:
for pnode in p_childNodes: p_childNodes = driver.execute_script("return arguments[0].childNodes;", nod)
article, number = recursion(pnode, article, number, driver, dircrea, True) for pnode in p_childNodes:
# txt = nod.text article, number = recursion(pnode, article, number, driver, dircrea, True)
# while len(txt) > 0 and txt[-1] == " ": except:
# txt = txt[:-1] txt = nod.text
# article += " **" + txt + "** " while len(txt) > 0 and txt[-1] == " ":
txt = txt[:-1]
article += " **" + txt + "** "
elif tag_name=="em": elif tag_name=="em":
if bk: if bk:
article += "**" article += "**"