From 2d3b82a4cffc946cdfa60d7906f31e0dd51981bc Mon Sep 17 00:00:00 2001 From: Norm Rasmussen Date: Wed, 25 Sep 2024 15:21:09 -0400 Subject: [PATCH] Pupeeteer was updated so had to change a few of the selector's lines --- Scripts/Walmart/Spark/single_resource.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Scripts/Walmart/Spark/single_resource.js b/Scripts/Walmart/Spark/single_resource.js index a3a32152..8118b52c 100644 --- a/Scripts/Walmart/Spark/single_resource.js +++ b/Scripts/Walmart/Spark/single_resource.js @@ -8,7 +8,8 @@ const apiKey = "6hUfJdAartHTHhHc0WIRZYPWe" // Luminate Production ^ const uid = "/\?uid\=7beg87y4-fh24-4929-3rt5-24kdn87s5241"; const groupIds = [ -'d9278062-762c-40d1-bb12-bfd9a00eea99', + '6c94e20c-aff7-465a-baaf-c32804fa7c9c', + 'fbadcf2b-db4a-4342-b1a7-15fc357e6443', ] const getAllGroups = async (num) => { @@ -42,7 +43,9 @@ async function courseOverview(id, i, num) { timeout: 0 }); await page.title(); - const [getXpath] = await page.$x('/html/body/div[1]/div'); + // const [getXpath] = await page.$$('/html/body/div[1]/div'); + // The above line kept giving the error "not a valid selector" + const [getXpath] = await page.$$('#course-mobile > div.np-card.cover-page-card > div > div > div.cover-page-card-title'); const resourcetitle = await page.evaluate(name => name.innerText, getXpath); // console.log(resourcetitle) const resource = resourcetitle.trim();