# article-fetch **Repository Path**: RishChen/article-fetch ## Basic Information - **Project Name**: article-fetch - **Description**: 这个玩意是自用的,可能存在很多问题,有兴趣的可以研究一下。 - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2019-08-06 - **Last Updated**: 2020-12-19 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README ## 小说抓取器 **抓取器使用JavaScript编写,依赖node.js环境执行** **能抓取包括但不限于“纵横中文网”等小说网站,仅限于免费小说,本抓取器并非破解网站会员。** #### 运行前需要安装依赖的工具 执行命令 ```shell npm install ``` #### 使用方法 编辑index.js ```js new Article().process('小说主页(包含章节目录)', 8 = ‘线程数,不输入默认单线程’) ``` #### 运行脚本,开始抓取 执行命令 ```shell npm start ``` #### 开发 目前能解析的小说网站仅支持```./libs```目录下的包含的js文件 如果想要抓取其它网站,可以尝试自己编码解析,编辑完成后,将对应网站的域名用以命名js,并放入```./libs```目录下即可 格式如下: ```js module.exports = { /** * 解析标题处理函数 * @param {string} html 章节目录页面html * @return {string} 返回小说标题 */ title: html => { ...解析处理 }, /** * 提取章节列表url * @param {string} html 章节目录页面html * @return [string] 返回章节url集合 */ chapterList: html => { ...解析处理 }, /** * 提取章节标题 * @param {string} html 章节内容页面html * @return {string} 返回章节标题 */ chapterTitle: html => { ...解析处理 }, /** * 提取章节内容 * @param {string} html 章节内容页面html * @return {string} 返回章节内容 */ chapterContent: html => { ...解析处理 } } ```