Fix has_next_page scraping logic

The next button doesn't appear on the last four pages. Instead, check if the selected page is the last page.
This commit is contained in:
Tyler Hallada 2022-09-26 00:15:25 -04:00
parent 203af0adc9
commit cf4e83c054

View File

@ -71,11 +71,11 @@ impl ModListResponse {
let last_update_date_select = let last_update_date_select =
Selector::parse("div.date").expect("failed to parse CSS selector"); Selector::parse("div.date").expect("failed to parse CSS selector");
let next_page_select = let next_page_select =
Selector::parse("div.pagination li.next").expect("failed to parse CSS selector"); Selector::parse("div.pagination li:last-child a.page-selected").expect("failed to parse CSS selector");
let next_page_elem = self.html.select(&next_page_select).next(); let next_page_elem = self.html.select(&next_page_select).next();
let has_next_page = next_page_elem.is_some(); let has_next_page = next_page_elem.is_none();
let mods: Vec<ScrapedMod> = self let mods: Vec<ScrapedMod> = self
.html .html