我试图使用beautifuldsoup来解析html,并使用一个特定的锚标记来查找所有的ref
<a href="http://example.com">TEXT</a>
<a href="http://example.com/link">TEXT</a>
<a href="http://example.com/page">TEXT</a>
我正在寻找的所有链接都有完全相同的锚文本,在本例中是文本。我不是在找文字,我想用文字找到所有不同的
编辑:
寻找类似于使用类解析链接的内容
<a href="http://example.com" class="visible">TEXT</a>
<a href="http://example.com/link" class="visible">TEXT</a>
<a href="http://example.com/page" class="visible">TEXT</a>
然后使用
findAll('a', 'visible')
除了我正在解析的HTML没有类,但是始终是相同的锚文本
想要这个吗?
相关问题 更多 >
编程相关推荐