16
我想创建一个与BeautifulSoup刮擦表。我写了这个Python代码:蟒蛇BeautifulSoup刮脸
import urllib2
from bs4 import BeautifulSoup
url = "http://dofollow.netsons.org/table1.htm" # change to whatever your url is
page = urllib2.urlopen(url).read()
soup = BeautifulSoup(page)
for i in soup.find_all('form'):
print i.attrs['class']
我需要刮诺姆,Cognome,电子邮件。
可以解释,为什么你需要的[2:]在您的第一线? – AZhao
@AZ很确定,它在答案中 - 跳过2个标题行。 – alecxe