Python爬虫(2)--BeautifulSoup的使用
2017-07-28 14:50
316 查看
# -*- coding: utf-8 -*- import urllib from bs4 import BeautifulSoup url = "http://www.baidu.com" page = urllib.urlopen(url) soup = BeautifulSoup(page,"html.parser") print soup
# -*- coding: utf-8 -*-from bs4 import BeautifulSouphelloworld = '<p>Hello World</p>'soup_string = BeautifulSoup(helloworld, "html.parser")print soup_string
先安装:http://www.crummy.com/software/BeautifulSoup/bs4/download/4.3/beautifulsoup4-4.3.2.tar.gz
相关文章推荐
- python3实现网络爬虫(6)--正则表达式和BeautifulSoup配合使用
- 使用python语言结合beautifulsoup编写简单的网络爬虫
- Python3.7 爬虫(三)使用 Urllib2 与 BeautifulSoup4 爬取网易云音乐歌单
- python爬虫——beautifulsoup4使用学习
- Python使用BeautifulSoup进行爬虫
- Python爬虫包 BeautifulSoup 学习(十) 各种html解析器的比较及使用
- Python爬虫之使用BeautifulSoup解析HTML文本
- python爬虫由浅入深3--BeautifulSoup的使用的基本方法
- Python 爬虫---(6) beautifulSoup 库的使用
- python爬虫主要就是五个模块:爬虫启动入口模块,URL管理器存放已经爬虫的URL和待爬虫URL列表,html下载器,html解析器,html输出器 同时可以掌握到urllib2的使用、bs4(BeautifulSoup)页面解析器、re正则表达式、urlparse、python基础知识回顾(set集合操作)等相关内容。
- Python爬虫学习---------使用beautifulSoup4爬取名言网
- 简单爬虫python实现02——BeautifulSoup的使用
- python爬虫之BeautifulSoup 使用select方法详解
- 【Python3.6爬虫学习记录】(二)使用BeautifulSoup爬取简单静态网页文章
- Python使用BeautifulSoup爬虫,和pyspider框架的使用
- Python 爬虫实战(一):使用 requests 和 BeautifulSoup
- python3实现网络爬虫(3)--BeautifulSoup使用(2)
- python爬虫:BeautifulSoup 使用select方法的使用
- python3实现网络爬虫(4)--BeautifulSoup使用(3)
- Python3.7 爬虫(二)使用 Urllib2 与 BeautifulSoup4 抓取解析网页