|
4 | 4 | // @name:zh-TW 懶人小説下載器 |
5 | 5 | // @name:ja 怠惰者小説ダウンロードツール |
6 | 6 | // @namespace hoothin |
7 | | -// @version 1.0 |
| 7 | +// @version 1.01 |
8 | 8 | // @description Fetch and download main content on current page |
9 | 9 | // @description:zh-CN 通用网站内容抓取工具,可批量抓取小说、论坛内容等并保存为TXT文档 |
10 | 10 | // @description:zh-TW 通用網站內容抓取工具,可批量抓取小說、論壇內容等並保存為TXT文檔 |
|
104 | 104 | var i,j,rStr="",pageData=(doc.body?doc.body:doc).cloneNode(true),delList=[]; |
105 | 105 | [].forEach.call(pageData.querySelectorAll("script,style,link"),function(item){delList.push(item);}); |
106 | 106 | [].forEach.call(delList,function(item){item.parentNode.removeChild(item);}); |
107 | | - var largestContent,contents=pageData.querySelectorAll("span,div,article,p,td,strong,font"); |
| 107 | + var largestContent,contents=pageData.querySelectorAll("span,div,article,p,td"); |
108 | 108 | for(i=0;i<contents.length;i++){ |
109 | 109 | let content=contents[i],hasText=false; |
110 | 110 | [].forEach.call(content.childNodes,function(item){ |
|
120 | 120 | } |
121 | 121 | } |
122 | 122 | if(content.firstChild && ( |
123 | | - (content.firstChild.nodeType!=3 && !/^(I|A|STRONG|FONT|BR)$/.test(content.firstChild.tagName)) || |
| 123 | + (content.firstChild.nodeType!=3 && !/^(I|A|STRONG|B|FONT|BR)$/.test(content.firstChild.tagName)) || |
124 | 124 | (content.firstChild.nodeType==3 && /^\s*$/.test(content.firstChild.data) && |
125 | | - (!content.childNodes[1] || !(content.childNodes[1].nodeType==3 || /^(I|A|STRONG|FONT|BR)$/.test(content.childNodes[1].tagName)))) |
| 125 | + (!content.childNodes[1] || !(content.childNodes[1].nodeType==3 || /^(I|A|STRONG|B|FONT|BR)$/.test(content.childNodes[1].tagName)))) |
126 | 126 | )) |
127 | 127 | continue; |
128 | 128 | if(pageData==document && content.offsetWidth<=0 && content.offsetHeight<=0) |
|
0 commit comments