beautifulSoup过滤一些数据

时间:2012-04-11 13:01:11

标签: python beautifulsoup

===改变 获取页面源后,我们称之为src

我使用bs4进行解析:

soup = BeautifulSoup(src)

我认为我正在获取过滤后的数据。

示例:查看此url =“http://www.imdb.com/name/nm0000905/”的来源 使用bs4之后:

soup = BeautifulSoup(src)

过滤后的数据是“已知”和“相关新闻”及其下的所有内容。 所以当打开汤时我会看到页面的上半部分。 (见python,not getting full response) 我还是想和bs4一起工作(我也有) 有什么建议吗?

感谢您的帮助。

1 个答案:

答案 0 :(得分:2)

连连呢?是的,使用the documentation中指定的库。