Python网络爬虫 - 2. Beautiful Soup小试牛刀
2015-09-16 11:27
513 查看
目标:
我们解析百度首页的logo
bs_baidu_logo.py
运行结果:
<img height="129" hidefocus="true" src="//www.baidu.com/img/bd_logo1.png" width="270"/>
我们解析百度首页的logo
bs_baidu_logo.py
from urllib.request import urlopen from bs4 import BeautifulSoup html = urlopen("http://www.baidu.com") bsObj = BeautifulSoup(html.read(), "html.parser") print(bsObj.img)
运行结果:
<img height="129" hidefocus="true" src="//www.baidu.com/img/bd_logo1.png" width="270"/>
相关文章推荐
- Linux网络配置及远程管理
- liferay 6.2 +httpclient4.5 调用 REST service
- Python网络爬虫 - 1. 准备工作
- 递归神经网络不可思议的有效性
- http状态码
- 网络IO之阻塞、非阻塞、同步、异步总结
- CCF 201403-4 无线网络 (二维最短路)
- Reachability 检测网络连接
- magento学习网址http://www.ruiwant.com/
- MPTCP 介绍
- iOS网络传输Delegate不被触发的本质原因
- Linux系统编程之错误处理:perror,strerror和errno http://www.linuxidc.com/Linux/2013-07/87238.htm
- TCP/IP协议栈分析详解(二)
- TCP/IP协议栈分析详解(一)
- eclipse 使用git碰到网络超时连接不了等问题的解决方法
- TCP通信的建立断开和状态转移
- linux网络编程中常用的辅助函数
- Httphandler
- Httpmoudle
- TCP/IP协议栈的基本工作原理