我正在尝试从网站创建可导入的日历事件。 该网站将事件聚集到一个标准的html表中
我想知道beautfulsoup是不是解决这个问题的正确方法,因为我只得到第一个条目,然后什么都没有
quote_page = "http://www.ellen-hartmann.de/babybasare.html"
page = urllib2.urlopen(quote_page)
soup = BeautifulSoup(page, "html.parser")
table = soup.find("table", {"border": "1"})
td = table.find("td", text="Veranstaltungstyp ")
print table
td_next = table.find_next("tr")
print td_next
我认为您停止使用是因为您使用了
find()
来获得一个匹配的标记,而不是find_all()
来获得所有匹配的标记。然后你得把结果循环一下相关问题 更多 >
编程相关推荐