diff --git a/src/lib/scrapers/downloads.ts b/src/lib/scrapers/downloads.ts index 8f16e93..c13baf8 100644 --- a/src/lib/scrapers/downloads.ts +++ b/src/lib/scrapers/downloads.ts @@ -1,4 +1,4 @@ -import cheerio from "cheerio"; +import { load } from "cheerio"; import { withBaseUrl } from "../utils"; @@ -14,7 +14,7 @@ export function getFinalDownloadUrl(downloadPageUrl: string) { } export function extractRedirectDownloadUrl(downloadPageHtml: string) { - const $ = cheerio.load(downloadPageHtml); + const $ = load(downloadPageHtml); const downloadUrl = $(`a.downloadButton`).attr("href"); if (!downloadUrl) { throw new Error("Could not find redirect download url"); @@ -23,7 +23,7 @@ export function extractRedirectDownloadUrl(downloadPageHtml: string) { } export function extractFinalDownloadUrl(downloadPageHtml: string) { - const $ = cheerio.load(downloadPageHtml); + const $ = load(downloadPageHtml); const downloadUrl = $(`.card-with-tabs a[href]`).attr("href"); if (!downloadUrl) { throw new Error("Could not find final download url"); diff --git a/src/lib/scrapers/variants.ts b/src/lib/scrapers/variants.ts index 7e6cfea..06e4f36 100644 --- a/src/lib/scrapers/variants.ts +++ b/src/lib/scrapers/variants.ts @@ -1,4 +1,4 @@ -import cheerio from "cheerio"; +import { load } from "cheerio"; import { match } from "ts-pattern"; import { isNotNull } from "../../utils/typescript"; @@ -12,7 +12,7 @@ export function getVariants(variantsPageUrl: string) { } export function extractVariants(variantsPageHtml: string) { - const $ = cheerio.load(variantsPageHtml); + const $ = load(variantsPageHtml); const table = $(".variants-table").first(); if (!table) { diff --git a/src/lib/scrapers/versions.ts b/src/lib/scrapers/versions.ts index e13eaac..8f0eccc 100644 --- a/src/lib/scrapers/versions.ts +++ b/src/lib/scrapers/versions.ts @@ -1,4 +1,4 @@ -import cheerio from "cheerio"; +import { load } from "cheerio"; import { isNotNull } from "../../utils/typescript"; import { withBaseUrl } from "../utils"; @@ -10,7 +10,7 @@ export function getVersions(repoPageUrl: string) { } export function extractVersions(versionsPageHtml: string) { - const $ = cheerio.load(versionsPageHtml); + const $ = load(versionsPageHtml); const table = $('.listWidget:has(a[name="all_versions"])').first(); if (!table) { throw new Error("Could not find versions table");