【发布时间】:2011-09-09 05:28:55
【问题描述】:
我有一个这样的html代码:
<h2 class="title"><a href="http://www.gurletins.com">My HomePage</a></h2>
<h2 class="title"><a href="http://www.gurletins.com/sections">Sections</a></h2>
我需要提取“a”标签之间的文本(链接描述)。我需要一个数组来存储这些:
a[0] = "我的主页"
a[1] = "节"
我需要使用 BeautifulSoup 在 python 中执行此操作。
请帮帮我,谢谢!
【问题讨论】:
标签: python text tags extract beautifulsoup