Pagetual

Perpetual pages - powerful auto-pager script. Auto fetching next paginated web pages and inserting into current page for infinite scroll. Support thousands of web sites without any rule.

< Feedback on Pagetual

Review: Good - script works

§
Posted: 2022-11-01

loadMore功能有點問題

    {
        "name": "看漫画手機版 - 漫画大全 檢視下20條記錄",
        "example": "https://m.manhuagui.com/list/update.html",
        "url": "^https://m\\.manhuagui\\.com/list/",
        "loadMore": "#more:not([style*='none'])>.more-go"
    },
    {
        "name": "看漫画手機版 - 最新更新/排行榜 檢視下20條記錄 MAX100",
        "example": "https://m.manhuagui.com/list/update.html",
        "url": "^https://m\\.manhuagui\\.com/(update|rank)/",
        "nextLinkByJs": "let more = document.querySelector(`#more:not([style*='none'])>.more-go`); if (more) more.click();"
    }

本來的寫法是上面兩個規則合併寫成這樣
"url": "^https://m\\.manhuagui\\.com/(list|update|rank)/",
"loadMore": "#more>.more-go"

結果在最新更新/排行榜頁面超過100項還會繼續loadMore
發現需要排除

所以元素改成#more:not([style*='none'])>.more-go
結果一樣繼續loadMore
貌似:not([style*='none'])被忽略了

改用nextLinkByJs才能避免繼續loadMore
可是nextLinkByJs在漫画大全頁面滑到560項左右就不會繼續觸發
但到主控台執行點擊代碼又有效
最後只好拆成兩個規則

hoothinAuthor
§
Posted: 2022-11-02

感謝反饋,這邊爲了避免浪費,找到loadMore之後,只要按鈕還在頁面之内就會直接調用,不再通過選擇器抓取,沒想到會有你上面貼出來的場景,我再優化一下

Post reply

Sign in to post a reply.