Skip to content

Instantly share code, notes, and snippets.

@tonywhite11
tonywhite11 / podquest-scraper-initial.js
Created April 17, 2024 10:56 — forked from heaversm/podquest-scraper-initial.js
chatGPT generated puppeteer scraper code
const puppeteer = require('puppeteer');
async function fillForm(data) {
const browser = await puppeteer.launch({ headless: true });
const page = await browser.newPage();
for (const item of data) {
await page.goto('YOUR_WEBPAGE_URL'); // Replace with your webpage URL
// Click the first "Select" button
@tonywhite11
tonywhite11 / podquest-scraper-final.js
Created April 17, 2024 10:56 — forked from heaversm/podquest-scraper-final.js
Puppeteer Scraper for Podquest
//import puppeteer
import puppeteer from 'puppeteer';
async function muiSelectOption(page, buttonSelector, optionValue) {
let liComponent;
let selectorSubstr = buttonSelector.substring(1); // Remove the leading '#' or '.'
if (optionValue) {
liComponent = `li[data-value="${optionValue}"]`;
} else {
liComponent = 'li:first-child';
@tonywhite11
tonywhite11 / cron.route.ts
Created September 30, 2023 15:50 — forked from adrianhajdin/cron.route.ts
Web Scraping Full Course 2023 | Build and Deploy eCommerce Price Tracker
import { NextResponse } from "next/server";
import { getLowestPrice, getHighestPrice, getAveragePrice, getEmailNotifType } from "@/lib/utils";
import { connectToDB } from "@/lib/mongoose";
import Product from "@/lib/models/product.model";
import { scrapeAmazonProduct } from "@/lib/scraper";
import { generateEmailBody, sendEmail } from "@/lib/nodemailer";
export const maxDuration = 300; // This function can run for a maximum of 300 seconds
export const dynamic = "force-dynamic";
@tonywhite11
tonywhite11 / cron.route.ts
Created September 30, 2023 15:50 — forked from adrianhajdin/cron.route.ts
Web Scraping Full Course 2023 | Build and Deploy eCommerce Price Tracker
import { NextResponse } from "next/server";
import { getLowestPrice, getHighestPrice, getAveragePrice, getEmailNotifType } from "@/lib/utils";
import { connectToDB } from "@/lib/mongoose";
import Product from "@/lib/models/product.model";
import { scrapeAmazonProduct } from "@/lib/scraper";
import { generateEmailBody, sendEmail } from "@/lib/nodemailer";
export const maxDuration = 300; // This function can run for a maximum of 300 seconds
export const dynamic = "force-dynamic";