python
K.S
努力!奋斗!
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
python爬虫之urllib模块的基本使用
urllib是python自带的基于爬虫的模块,主要使用其中的两个子模块request和parsefrom urllib import request# 爬取搜狗首页数据#1 指定urlurl = "https://www.sogou.com/"#2 发起请求...原创 2019-06-15 16:37:56 · 241 阅读 · 0 评论 -
python爬虫之requests模块的基本使用
GET请求import requestsurl = "https://www.baidu.com"headers = { "User_Agent": "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 " "(KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36" ...原创 2019-06-17 12:09:20 · 569 阅读 · 0 评论 -
python爬虫之bs4的基本使用
BeautifulSoup可以很方便地查找HTML标签以及其中的属性和内容import requestsfrom bs4 import BeautifulSoup# 创建BeautifulSoup对象# 当数据来源为本地文件时file = open("xxx.html")soup = BeautifulSoup(file, "lxml")# 当数据来源为网络时content =...原创 2019-06-17 21:22:07 · 11524 阅读 · 0 评论
分享