Python BeautifulSoup如何提取<a>标记之间的文本

2024-06-05 19:20:00 发布

您现在位置:Python中文网/ 问答频道 /正文

我想用Python3中的beauthulsoup4从这个源代码中提取一个数字“371”。 我试了很多次,但都做不到,你能帮帮我吗?谢谢您。在

<a href="/ProviderRedirect.ashx?key=0.16198127.422314246.13.PLN.1277906077&amp;saving=551&amp;source=1-0" id="TotalLink" target="_blank"><span class="hc_pr_cur">PLN</span> 371<span class="hc_pr_syb"></span></a>

Tags: keyhc源代码数字prpython3classamp