⛏ Added LOCG series href scraping util

This commit is contained in:
2022-03-26 22:30:56 -07:00
parent b476ad77be
commit b50d9fea78
4 changed files with 38 additions and 12 deletions

View File

@@ -41,3 +41,17 @@ export const scrapeIssuesFromSeriesPage = async (url: string) => {
issues,
};
};
export const scrapeIssuePage = async (url: string) => {
const response = await axios(url);
const dom = new JSDOM(response.data, {
url,
referrer: url,
contentType: "text/html",
includeNodeLocations: true,
storageQuota: 10000000,
});
const seriesDOMElement = dom.window.document
.querySelector("div.series-pagination > a.series").getAttribute("href");
return seriesDOMElement;
};