# ComicSpider
The first open-source crawler of raw comics images on [dmzj](http://manhua.dmzj.com/) website.
第一个开源的[动漫之家](http://manhua.dmzj.com/)漫画站电脑版原图爬虫
# 尊重版权,只供爱好者研究使用,禁止商业用途,保留追究法律责任的权利
# Requirements依赖项
python3,git
requests,phantomJS,selenium
optional:pyinstaller,PyQt5(for GUI)
# Description描述
The first open-source crawler of raw comics images on [dmzj](http://manhua.dmzj.com/) website.Used [PhantomJS](http://phantomjs.org/),and [selenuium](https://github.com/SeleniumHQ/selenium) to get the index of pages for each chapter of a comic. Download and save the all pages to local files.
The implementation of crawler's logic is in `comic.py`,you can develop your own crawler programs based on it.
We provide a console crawler `download_f.py` and a GUI crawler `comic_gui.py`.
And we also provide packaged win32/64 `.exe` programs.
第一个从[动漫之家](http://manhua.dmzj.com/)漫画站爬取电脑版原图的开源爬虫。使用[PhantomJS](http://phantomjs.org/),和 [selenuium](https://github.com/SeleniumHQ/selenium)获取每个漫画章节的分页索引。爬取并下载漫画图片到本地文件。
爬虫逻辑实现在`comic.py`,功能完整,支持增量下载,可供开发者自行开发爬虫。
提供命令行`download_f.py`和图形界面`comic_gui.py`两种爬虫程序。
提供打包好的win32/64 `.exe`程序。
# Usage使用
## 中文版本:
安装依赖 。
在命令行cmd或终端:
git clone https://github.com/QuantumLiu/ComicSpider.git
下载 [PhantomJS](http://phantomjs.org/), 解压并将`phantomjs.exe`文件放在`.py`文件的同一个文件夹。或者把`phantomjs.exe`所在路径添加到环境变量`PATH`。
如果需要使用二进制文件 (Windows),请下载最新的 [releases](https://github.com/QuantumLiu/ComicSpider/releases).
#### GUI版本:
使用源码:
python comic_gui.py
或双击`comic_gui.exe`
输入你想要爬取的漫画的地址
![GUI运行](./pics/gui1.PNG)
如果点击`预览`可预览漫画封面及相关信息,并自动生成一个保存目录。
![预览1](./pics/预览.PNG)
![预览2](./pics/预览2.PNG)
可选择是否使用多线程。
输入或点击`选择目录`来制定保存目录。
点击`爬取`开始爬取漫画。
![爬取](./pics/爬取.PNG)
#### 命令行版本:
请在 `ComicSpider/` 文件夹创建一个文本文件,并写入你要下载的漫画的网址。
例如,将以下内容写入 `url.txt`:
http://manhua.dmzj.com/dcyuzhouchongsheng/
http://manhua.dmzj.com/sanweiyitiv2/
![url](./pics/url.PNG)
那么程序将下载这两部漫画:
![cs](./pics/重生.PNG)
![three](./pics/三位一体.PNG)
在cmd/shell:
cd ComicSpider
python download_f.py url.txt 1
有两个可选参数:
第一个参数用来指定存放要下载的漫画地址的文本文件的路径,默认值为 './url.txt'.
最后一个参数用来指定是否使用多线程。'1' 即 'True' e其他的是 'False'.默认值 'False'.
运行结果:
![运行](./pics/运行.PNG)
![结果](./pics/结果.PNG)
如你所见,程序创建了一个漫画文件夹,里面是各个章节的文件夹,每个章节文件夹内存放每一页的jpg文件。
或者使用二进制文件:
双击 `comicspider_console.exe` 将以默认值运行。
或者在 cmd/shell/.bat:
comicspider_console \<your file\> \<multi-threads flag\>
## English version:
Install all dependencies.
In cmd/shell:
git clone https://github.com/QuantumLiu/ComicSpider.git
Download [PhantomJS](http://phantomjs.org/), and copy it to the same floder of `.py` files.Or add the path of the `phantomjs.exe` file to `PATH`.
If you want to use the binary package, download the lastest [releases](https://github.com/QuantumLiu/ComicSpider/releases).
#### GUI version:
From source codes:
python comic_gui.py
Or click `comic_gui.exe`
Type the urls of comics you want to download.
![GUI运行](./pics/gui1.PNG)
If you click `预览` you can preview the cover and infos of the comic, and fill a auto-choice directory to save comic images.
![预览1](./pics/预览.PNG)
![预览2](./pics/预览2.PNG)
You can choose whether useing multi-threading.
Type a directory or click `选择目录` to configure the save directory.
Click `爬取` to start crawling.
![爬取](./pics/爬取.PNG)
#### Console version:
Please create a text file in `ComicSpider/` and write the urls of comics you want to download.
For example,write following urls in `url.txt`:
http://manhua.dmzj.com/dcyuzhouchongsheng/
http://manhua.dmzj.com/sanweiyitiv2/
![url](./pics/url.PNG)
So the program will download those two comics:
![cs](./pics/重生.PNG)
![three](./pics/三位一体.PNG)
Download [PhantomJS](http://phantomjs.org/), and copy it to the same floder of .py files.Or add the path of the .exe file to PATH.
Then in cmd/shell:
cd ComicSpider
python download_f.py url.txt 1
There are two arguments:
First is used to configure the url text file,the default value is './url.txt'.
The last argument is weather using multi threads.'1' for 'True' else for 'False'.Deafult for 'False'.
Results:
![运行](./pics/运行.PNG)
![结果](./pics/结果.PNG)
As you see, the program collected a comic in one floder and below the floder are chapter floders, in each chapter floder there are .jpg files of all pages of the chapter.
Or using packaged binary program:
Double click `comicspider_console.exe` to run with deafult arguments.
Or in cmd/shell/.bat:
comicspider_console \<your file\> \<multi-threads flag\>
# Packaging打包
Require pyinstaller.
run `make.bat`
# Future
更多可指定参数
非阻塞显示图片
基于itchat的微信扩展
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
爬虫(Web Crawler)是一种自动化程序,用于从互联网上收集信息。其主要功能是访问网页、提取数据并存储,以便后续分析或展示。爬虫通常由搜索引擎、数据挖掘工具、监测系统等应用于网络数据抓取的场景。 爬虫的工作流程包括以下几个关键步骤: URL收集: 爬虫从一个或多个初始URL开始,递归或迭代地发现新的URL,构建一个URL队列。这些URL可以通过链接分析、站点地图、搜索引擎等方式获取。 请求网页: 爬虫使用HTTP或其他协议向目标URL发起请求,获取网页的HTML内容。这通常通过HTTP请求库实现,如Python中的Requests库。 解析内容: 爬虫对获取的HTML进行解析,提取有用的信息。常用的解析工具有正则表达式、XPath、Beautiful Soup等。这些工具帮助爬虫定位和提取目标数据,如文本、图片、链接等。 数据存储: 爬虫将提取的数据存储到数据库、文件或其他存储介质中,以备后续分析或展示。常用的存储形式包括关系型数据库、NoSQL数据库、JSON文件等。 遵守规则: 为避免对网站造成过大负担或触发反爬虫机制,爬虫需要遵守网站的robots.txt协议,限制访问频率和深度,并模拟人类访问行为,如设置User-Agent。 反爬虫应对: 由于爬虫的存在,一些网站采取了反爬虫措施,如验证码、IP封锁等。爬虫工程师需要设计相应的策略来应对这些挑战。 爬虫在各个领域都有广泛的应用,包括搜索引擎索引、数据挖掘、价格监测、新闻聚合等。然而,使用爬虫需要遵守法律和伦理规范,尊重网站的使用政策,并确保对被访问网站的服务器负责。
资源推荐
资源详情
资源评论
收起资源包目录
动漫之家漫画站电脑版原图爬虫.zip (18个子文件)
SJT-code
batman.ico 66KB
make.bat 280B
comic.py 9KB
LICENSE 34KB
comic_gui.py 6KB
pics
结果.PNG 385KB
gui1.PNG 7KB
三位一体.PNG 182KB
url.PNG 14KB
运行.PNG 104KB
预览2.PNG 39KB
预览.PNG 330KB
爬取.PNG 50KB
重生.PNG 174KB
DC Universe - Rebirth (2016) 001-000.jpg 193KB
url.txt 36B
download_f.py 688B
README.md 6KB
共 18 条
- 1
资源评论
JJJ69
- 粉丝: 6222
- 资源: 5780
下载权益
C知道特权
VIP文章
课程特权
开通VIP
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功