nordmarin / gsmarena-api

Parse GSMArena website then return data as JSON
MIT License
92 stars 39 forks source link

Pagination does not work anymore (It return only devices from first page) #11

Closed dandys71 closed 6 months ago

dandys71 commented 7 months ago

They've made some changes on their website, so now it only return devices from the first page. If you want to make it work again just change function getNextPage in catalog.js from this: const getNextPage = ($) => { const nextPage = $('a.pages-next').attr('href'); if (nextPage) { if (nextPage.indexOf('#') >= 0) { return false; } return nextPage.replace('.php', ''); } return false; };

to this: const getNextPage = ($) => { const nextPage = $('a.prevnextbutton[title="Next page"]').attr('href'); if (nextPage) { return nextPage.replace('.php', ''); } return false; };

nordmarin commented 6 months ago

Yes, it really stopped working :(

Fixed it, thanks a lot for your help!