首页 > Web开发 > 详细

二 解析网页中元素

时间:2017-03-07 00:28:45      阅读:252      评论:0      收藏:0      [点我收藏+]

一 使用beautifulSoup 解析网页

 Soup = BeantifulSoup(html,‘lxml‘)

二 描述需要爬取的东西在哪?

  = Soup.select(‘???‘)

三 从标签中获得你要的信息

  <p>Something</p> 去掉标签,并放到数据容器中。

title.get_text() > Something

title.tripped_strings>获取title目录下,所有标签。

python 可以做列表》list(title.tripped_strings)

  {title = Something ; rate = 4.0}

 

二 解析网页中元素

原文:http://www.cnblogs.com/cbds/p/6512560.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!