Anthology script for domain names. Used get courses for Walmart, and made a backup of the screenshots for 1-off courses. Glassdoor and todo notes.
This commit is contained in:
@ -17,7 +17,7 @@ const getAllGroups = async (num) => {
|
||||
|
||||
await axios({
|
||||
method: 'get',
|
||||
url: 'https://api2.northpass.com/v2/courses?page=${page}&limit=200',
|
||||
url: 'https://api2.northpass.com/v2/courses?page=${page}&limit=100',
|
||||
headers: {
|
||||
'accept': '*/*',
|
||||
'x-api-key': apiKey,
|
||||
@ -83,17 +83,17 @@ async function courseOverview(id, i, num) {
|
||||
const resource = resourcetitle.trim();
|
||||
console.log(resource);
|
||||
|
||||
await page.screenshot({path: `${resource}_1.png`, fullPage:true, headless:"new"});
|
||||
await page.screenshot({path: `${resource}_1.png`, fullPage:true });
|
||||
|
||||
const hrefs = await page.$$eval('a', as => as.map(a => a.href));
|
||||
var links = Object.entries(hrefs);
|
||||
console.log(links)
|
||||
// console.log(links)
|
||||
links.forEach(([key, value]) => {
|
||||
var link = value;
|
||||
if (link.includes("activities") && (link.includes(id))) {
|
||||
console.log("Activities Link")
|
||||
console.log(link);
|
||||
activity.push(link);
|
||||
var link = value;
|
||||
if (link.includes("activities") && (link.includes(id))) {
|
||||
// console.log("Activities Link")
|
||||
// console.log(link);
|
||||
activity.push(link);
|
||||
}
|
||||
});
|
||||
setTimeout(() => {
|
||||
@ -109,7 +109,7 @@ async function courseOverview(id, i, num) {
|
||||
await page.goto(newlink, {
|
||||
waitUntil: 'load',
|
||||
timeout: 0 });
|
||||
await page.screenshot({path: `${resource}_${num}.png`, fullPage: true, headless:"new"});
|
||||
await page.screenshot({path: `${resource}_${num}.png`, fullPage: true });
|
||||
screenshots(newlink, resource, num, i);
|
||||
}
|
||||
await browser.close();
|
||||
|
||||
Reference in New Issue
Block a user