![](https://img-blog.csdnimg.cn/20201014180756922.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
python爬虫
「已注销」
这个作者很懒,什么都没留下…
展开
-
Python爬虫:如何创建BeautifulSoup对象
from urllib.request import urlopenfrom bs4 import BeautifulSouphtml = '<div>text1</div>'html = urlopen("http://www.pythonscraping.com/pages/page3.html")html = open('c:\\aa.html')#以上三行表示了HTML的三种来源,一是原创 2017-06-18 23:34:21 · 2431 阅读 · 0 评论 -
Python爬虫例子1
网页http://www.pythonscraping.com/pages/warandpeace.html这是战争与和平,里面绿色的字是人名。网页源代码快捷键Ctrl+U即可显示网页源代码 观察源代码,发现都是<span class="red">或者<span class="green">里面表示人名的绿色字体就是<span class="green">Python抓取代码from urllib原创 2017-06-12 21:00:15 · 550 阅读 · 0 评论 -
python爬虫:抓取页面上的超链接
Beautiful Soup 是一个可以从HTML或XML文件中提取数据的Python库.它能够通过你喜欢的转换器实现惯用的文档导航,查找,修改文档的方式.Beautiful Soup会帮你节省数小时甚至数天的工作时间.页面上的超链接在HTML中,超链接用a表示,链接地址写作 href=。。。<a href='http://www.baidu.com'>baidu</a>发布到浏览器上就是:点击这原创 2017-07-14 14:24:28 · 57826 阅读 · 4 评论