我试图在超文本文件中从一档tag子中提取可供人阅读的文本,但从bs4中获取(文本)功能似乎根本不提取任何东西。
这方面的一个例子是:
P Tag: Launched in 2022, TikTok Shop has become a game-changing addition to the platform. It transformed it into a one-stop shop for both content and online shopping. Integrated within the app, the TikTok Shop allowed creators to sell their products through their content, live stream, and by running ads on the platform.
P text: None
image
我的守则是:
soup = BeautifulSoup(html, html.parser )
p_tags = soup.find_all( p )
print( P Tags: , p_tags)
for p in p_tags:
print( P type: , type(p))
print( P: , p)
print( P text: , p.text)
我检查了我的物体是 b4。 我使用LMXL教区。 我用正文而不是正文进行审判。