大数据 爬虫Python AI SqlPython学习data mine

干货|18个Python爬虫实战案例(已开源)

2019-01-23  本文已影响15人  1a076099f916

目录

爬虫小工具

一个可以用于下载图片、视频、文件的小工具,有下载进度显示功能。稍加修改即可添加到自己的爬虫中。

进群:700341555获取Python爬虫学习资料!

动态示意图:

干货|18个Python爬虫实战案例(已开源)

爬虫实战

1、biqukan.py:《笔趣看》盗版小说网站,爬取小说工具

第三方依赖库安装:

<pre style="-webkit-tap-highlight-color: transparent; box-sizing: border-box; font-family: Consolas, Menlo, Courier, monospace; font-size: 16px; white-space: pre-wrap; position: relative; line-height: 1.5; color: rgb(153, 153, 153); margin: 1em 0px; padding: 12px 10px; background: rgb(244, 245, 246); border: 1px solid rgb(232, 232, 232); font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial;">

pip3 install beautifulsoup4

</pre>

使用方法:

<pre style="-webkit-tap-highlight-color: transparent; box-sizing: border-box; font-family: Consolas, Menlo, Courier, monospace; font-size: 16px; white-space: pre-wrap; position: relative; line-height: 1.5; color: rgb(153, 153, 153); margin: 1em 0px; padding: 12px 10px; background: rgb(244, 245, 246); border: 1px solid rgb(232, 232, 232); font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial;">

python biqukan.py

</pre>

2、video_downloader:爱奇艺等主流视频网站的VIP视频破解助手(暂只支持PC和手机在线观看VIP视频!)

感谢Python3二维码生成器作者:https://github.com/sylnsfar/qrcode

编译好的软件下载连接:https://pan.baidu.com/s/1bqSTNJL 密码:p8bs

解压密码:cuijiahua.com

无需Python3环境,在Windows下,解压即用!软件使用方法

源码可查看video_downloader,运行源码需要搭建Python3环境,并安装相应第三方依赖库:

video_downloader文件夹下,安装第三方依赖库:

<pre style="-webkit-tap-highlight-color: transparent; box-sizing: border-box; font-family: Consolas, Menlo, Courier, monospace; font-size: 16px; white-space: pre-wrap; position: relative; line-height: 1.5; color: rgb(153, 153, 153); margin: 1em 0px; padding: 12px 10px; background: rgb(244, 245, 246); border: 1px solid rgb(232, 232, 232); font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial;">

pip3 install -r requirements.txt

</pre>

使用方法:

<pre style="-webkit-tap-highlight-color: transparent; box-sizing: border-box; font-family: Consolas, Menlo, Courier, monospace; font-size: 16px; white-space: pre-wrap; position: relative; line-height: 1.5; color: rgb(153, 153, 153); margin: 1em 0px; padding: 12px 10px; background: rgb(244, 245, 246); border: 1px solid rgb(232, 232, 232); font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial;">

python movie_downloader.py

</pre>

运行环境:

3、baiduwenku.py:百度文库word文章爬取

4、shuaia.py:爬取《帅啊》网,帅哥图片

第三方依赖库安装:

<pre style="-webkit-tap-highlight-color: transparent; box-sizing: border-box; font-family: Consolas, Menlo, Courier, monospace; font-size: 16px; white-space: pre-wrap; position: relative; line-height: 1.5; color: rgb(153, 153, 153); margin: 1em 0px; padding: 12px 10px; background: rgb(244, 245, 246); border: 1px solid rgb(232, 232, 232); font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial;">

pip3 install requests beautifulsoup4

</pre>

5、daili.py:构建代理IP池

6、carton:使用Scrapy爬取《火影忍者》漫画

代码可以爬取整个《火影忍者》漫画所有章节的内容,保存到本地。更改地址,可以爬取其他漫画。保存地址可以在settings.py中修改。

动漫网站:http://comic.kukudm.com/

7、hero.py:《王者荣耀》推荐出装查询小助手

网页爬取已经会了,想过爬取手机APP里的内容吗?

8、financical.py: 财务报表下载小助手

爬取的数据存入数据库会吗?《跟股神巴菲特学习炒股之财务报表入库(MySQL)》也许能给你一些思路。

动态示意图:

干货|18个Python爬虫实战案例(已开源)

9、one_hour_spider:一小时入门Python3网络爬虫。

原理说明:

本次实战内容有:

10、douyin.py:抖音App视频下载

抖音App的视频下载,就是普通的App爬取。

11、douyin_pro:抖音App视频下载(升级版)

抖音App的视频下载,添加视频解析网站,支持无水印视频下载,使用第三方平台解析。

12、douyin_pro_2:抖音App视频下载(升级版2)

抖音App的视频下载,添加视频解析网站,支持无水印视频下载,通过url解析,无需第三方平台。

干货|18个Python爬虫实战案例(已开源)

13、geetest.py:GEETEST验证码破解

爬虫最大的敌人之一是什么?没错,验证码!Geetest作为提供验证码服务的行家,市场占有率还是蛮高的。遇到Geetest提供的滑动验证码怎么破?授人予鱼不如授人予渔,接下来就为大家呈现本教程的精彩内容。

动态示意图:

干货|18个Python爬虫实战案例(已开源)

14、12306.py:用Python抢火车票简单代码

可以自己慢慢丰富,蛮简单,有爬虫基础很好操作,没有原理说明。

15、baiwan:百万英雄辅助答题

效果图:

干货|18个Python爬虫实战案例(已开源)

功能介绍:

16、Netease:根据歌单下载网易云音乐

效果图:

干货|18个Python爬虫实战案例(已开源)

功能介绍:根据music_list.txt文件里的歌单的信息下载网易云音乐,将自己喜欢的音乐进行批量下载。

17、bilibili:B站视频和弹幕批量下载

使用说明:

<pre style="-webkit-tap-highlight-color: transparent; box-sizing: border-box; font-family: Consolas, Menlo, Courier, monospace; font-size: 16px; white-space: pre-wrap; position: relative; line-height: 1.5; color: rgb(153, 153, 153); margin: 1em 0px; padding: 12px 10px; background: rgb(244, 245, 246); border: 1px solid rgb(232, 232, 232); font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial;">

python bilibili.py -d 猫 -k 猫 -p 10

</pre>

三个参数:

-d 保存视频的文件夹名

-k B站搜索的关键字

-p 下载搜索结果前多少页

上一篇 下一篇

猜你喜欢

热点阅读