⭐Append the next page content to the bottom seamlessly (like a waterfall, Unlimited scrolling, no need to manually click on the next page) ⭐, support various forums, social networking, games, comics, novels, academics, search engines (Google, Bing, Yahoo...) and other websites~
作者的規則說明需要詳細閱讀過
https://github.com/XIU2/UserScript/issues/176
最基本的至少要會寫CSS選擇器
以chrome瀏覽器為例,按F12或Ctrl+Shift+I或由右上選單>更多工具>開發人員工具,試著學習使用開發人員工具,按開發人員工具左上的箭頭或快捷鍵Ctrl+Shift+C,可以選取頁面元素,用來查看下一頁元素和主體元素。
最簡單的方式是選擇元素後按滑鼠右鍵>複製>複製selector,就能產生css選擇器,然後填入nextL、pageE、replaceE,不過這樣CSS選擇器可能會很長。
簡單說明舉例下一頁元素
a標籤 屬性id="next" 屬性class="next"
css這樣寫
a#next.next,屬性id用#表示,屬性class用.表示。
也能這樣寫
a[id='next'][class='next']
格式:標籤名[標籤屬性1='值'][標籤屬性2='值']
XPath這樣寫
//a[@id='next'][@class='next']
開發人員工具>元素,按Ctrl+F就能練習寫選擇器。
"www.shein.tw": { "host": "www.shein.tw", "url": "if(fun.getCSS('.sui-pagination')){if(location.href.indexOf('page=')==-1)fun.getCSS('.sui-pagination span[aria-current]').click();return true}", "pager": { "nextL": "js; return fun.getNextUP('page=', /page=\\d+/)", "pageE": ".product-list>.S-product-item", "scrollE": ".sui-pagination" }, "function": { "bF": "return fun.src_bF(pageE)" } }, "www.zaful.com": { "host": "www.zaful.com", "url": "return fun.getCSS('.page-wrap.js_page_num')", "pager": { "nextL": "//a[not(@class='disabled') and i[@class='next']]", "pageE": "#js_proList .js_proList_item", "replaceE": ".page-wrap.js_page_num" }, "function": { "bF": "return fun.src_bF(pageE, [0,'img[data-original]','data-original'])" } }, "www.rihoas.com": { "host": "www.rihoas.com", "url": "return fun.getCSS('.pagination')", "pager": { "nextL": ".pagination>a.next", "pageE": ".collection-listing .product-block", "replaceE": ".pagination" }, "function": { "bF": "pageE.forEach(e=>{e.className='product-block cc-animate-init -in cc-animate-complete'});return pageE" } }, "www.temu.com": { "host": "www.temu.com", "url": "return fun.getCSS('[class^=loadMoreWrap]')", "pager": { "type": 2, "nextL": "[class^=loadMoreWrap]>[class^=wrap]" } }
特别感谢
作者的規則說明需要詳細閱讀過
https://github.com/XIU2/UserScript/issues/176
最基本的至少要會寫CSS選擇器
以chrome瀏覽器為例,按F12或Ctrl+Shift+I或由右上選單>更多工具>開發人員工具,試著學習使用開發人員工具,按開發人員工具左上的箭頭或快捷鍵Ctrl+Shift+C,可以選取頁面元素,用來查看下一頁元素和主體元素。
最簡單的方式是選擇元素後按滑鼠右鍵>複製>複製selector,就能產生css選擇器,然後填入nextL、pageE、replaceE,不過這樣CSS選擇器可能會很長。
簡單說明舉例下一頁元素
a標籤 屬性id="next" 屬性class="next"
css這樣寫
a#next.next,屬性id用#表示,屬性class用.表示。
也能這樣寫
a[id='next'][class='next']
格式:標籤名[標籤屬性1='值'][標籤屬性2='值']
XPath這樣寫
//a[@id='next'][@class='next']
開發人員工具>元素,按Ctrl+F就能練習寫選擇器。"www.shein.tw": { "host": "www.shein.tw", "url": "if(fun.getCSS('.sui-pagination')){if(location.href.indexOf('page=')==-1)fun.getCSS('.sui-pagination span[aria-current]').click();return true}", "pager": { "nextL": "js; return fun.getNextUP('page=', /page=\\d+/)", "pageE": ".product-list>.S-product-item", "scrollE": ".sui-pagination" }, "function": { "bF": "return fun.src_bF(pageE)" } }, "www.zaful.com": { "host": "www.zaful.com", "url": "return fun.getCSS('.page-wrap.js_page_num')", "pager": { "nextL": "//a[not(@class='disabled') and i[@class='next']]", "pageE": "#js_proList .js_proList_item", "replaceE": ".page-wrap.js_page_num" }, "function": { "bF": "return fun.src_bF(pageE, [0,'img[data-original]','data-original'])" } }, "www.rihoas.com": { "host": "www.rihoas.com", "url": "return fun.getCSS('.pagination')", "pager": { "nextL": ".pagination>a.next", "pageE": ".collection-listing .product-block", "replaceE": ".pagination" }, "function": { "bF": "pageE.forEach(e=>{e.className='product-block cc-animate-init -in cc-animate-complete'});return pageE" } }, "www.temu.com": { "host": "www.temu.com", "url": "return fun.getCSS('[class^=loadMoreWrap]')", "pager": { "type": 2, "nextL": "[class^=loadMoreWrap]>[class^=wrap]" } }
注意完整格式要正确
{ 在花括号中间粘贴我提供的规则 }
如果已经有其他自定义规则,中间的规则花括号之间是要用,做区隔的。
{ "规则1":{ }, "规则2":{ } }
注意完整格式要正确
{ 在花括号中间粘贴我提供的规则 }如果已经有其他自定义规则,中间的规则花括号之间是要用,做区隔的。
{ "规则1":{ }, "规则2":{ } }
非常感谢
申请一下,www.shein.com https://www.zaful.com/ https://www.rihoas.com/ https://www.temu.com/
感谢作者,该脚本非常实用。
可以麻烦作者出一期怎么自定义网页的视频教程吗,文字的对于我们没有基础的人看了很迷糊