![](https://img-blog.csdnimg.cn/20190927151053287.png?x-oss-process=image/resize,m_fixed,h_224,w_224)
5.python网络爬虫入门
国民小跟班
喜欢总结、极简主义、观点分享、懒人懒办法系列
展开
-
selenium学习总结
#网页初始化from selenium import webdriverdriver=webdriver.Chrome() #创建浏览器对象driver.get(url) #转跳网页#常用的定位方式#1.获取单一的标签driver.find_element_by_class_name("属性名") #根据属性定位driver.find_element_by_i...原创 2019-11-28 15:59:28 · 115 阅读 · 0 评论 -
快速python网络爬虫入门(学习目录)
一、网络采集的一般流程.二、网络采集的常用工具.三、复杂HTML的解析.四、采集单一网页特定数据.五、遍历多个网页进行采集.原创 2019-10-24 18:33:50 · 179 阅读 · 0 评论 -
python网络爬虫入门(五、遍历多个网页进行采集)
批量下载晋江城的小说import requestsfrom bs4 import BeautifulSoupimport reimport osimport pandas as pd# 1.获取小说名称def get_article_title(main_url): soup=get_html(main_url) article_title=soup.find("s...原创 2019-10-24 17:10:19 · 1070 阅读 · 0 评论 -
python网络爬虫入门(四、采集单一网页特定数据)
一、采集标题和文本#一、文本采集import requestsfrom bs4 import BeautifulSoupimport reimport osimport pandas as pd#一、解析文件url="http://www.jjwxc.net/onebook.php?novelid=4328853&chapterid=10" headers={"User...原创 2019-10-24 16:06:35 · 515 阅读 · 0 评论 -
python网络爬虫入门(三、复杂HTML的解析)
一、使用标签名和属性#1.使用标签 import requestsfrom bs4 import BeautifulSoupurl="http://www.runoob.com/html/html-intro.html" r=requests.get(url) html=r.text.encode(r.encoding).decode() soup=Beautiful...原创 2019-10-24 15:54:51 · 477 阅读 · 0 评论 -
python网络爬虫入门(二、网络采集的常用工具)
一、框架二、常用工具1.用FireFox查看目标网页信息2.request获取网页信息3.用Beautiful和re进行数据清洗4.使用Selenium和Phantmjs处理动态网页原创 2019-10-24 15:40:28 · 210 阅读 · 0 评论 -
python网络爬虫入门(一、网络采集的一般流程)
一、 爬虫的基本步骤1.通过网站域名获取HTML数据#1.requests方法import requests url="http://www.runoob.com/html/html-intro.html" #1.请求地址r=requests.get(url) #2.发送请求html=r.text.encode(...原创 2019-10-23 00:15:35 · 1671 阅读 · 0 评论