我正在使用BeautifulSoup阅读网页的内容。我想要的只是抓住<a href>,以http://开头。我知道在美丽的你可以通过属性进行搜索。我想我只是有一个语法问题。我会想象它会像这样。 page = urllib2.urlopen("http://www.linkpages.com")
soup = BeautifulSoup(page)
for link in soup.findAl
我有一个文件这样之间的兄弟节点: <p class="top">I don't want this</p>
<p>I want this</p>
<table>
<!-- ... -->
</table>
<img ... />
<p> and all that stuff too</p>
<p class="end>But not this and nothing
我试图与特定HTML文件 from BeautifulSoup import BeautifulSoup
import re
import codecs
import sys
f = open('test1.html')
html = f.read()
soup = BeautifulSoup(html)
body = soup.body.contents
para = soup.