Closed niauah closed 3 years ago
for i, phiau_tag in enumerate(parser.p.contents): # 這个content是純文字 if phiau_tag.name is None: sin_html.p.append(phiau_tag.string) else: # ...
輸入ê兩詞中央有空白ê時陣
<p><span class="lui-1">Hit</span> <span class="lui-2">lō</span></p>
append(phiau_tag.string) 會造成for loop減走一个,毋知影是siánn原因 改做append(str(phiau_tag)) 才會使
append(phiau_tag.string)
append(str(phiau_tag))
(兩个type無kâng,phiau_tag.string是 NavigableString) https://www.crummy.com/software/BeautifulSoup/bs4/doc/index.html?highlight=new_tag#navigablestring
phiau_tag.string
NavigableString
看起來處理好勢--ah?
輸入ê兩詞中央有空白ê時陣
append(phiau_tag.string)
會造成for loop減走一个,毋知影是siánn原因 改做append(str(phiau_tag))
才會使(兩个type無kâng,
phiau_tag.string
是NavigableString
) https://www.crummy.com/software/BeautifulSoup/bs4/doc/index.html?highlight=new_tag#navigablestring