bluebeard
02/02/2025, 5:04 PM// For more information, see https://crawlee.dev/
import { PlaywrightCrawler } from 'crawlee';
import { firefox } from 'playwright';
// PlaywrightCrawler crawls the web using a headless
// browser controlled by the Playwright library.
const crawler = new PlaywrightCrawler({
launchContext: {
launcher: firefox,
},
maxRequestRetries: 1,
// Use the requestHandler to process each of the crawled pages.
async requestHandler({ request, page, enqueueLinks, log, pushData }) {
await page.waitForTimeout(5000);
const title = await page.title();
log.info(`Title of ${request.loadedUrl} is '${title}'`);
// Save results as JSON to ./storage/datasets/default
await pushData({ title, url: request.loadedUrl });
// Extract links from the current page
// and add them to the crawling queue.
// await enqueueLinks();
},
// Comment this option to scrape the full website.
maxRequestsPerCrawl: 1,
// Uncomment this option to see the browser window.
headless: false,
});
// Add first URL to the queue and start the crawl.
await crawler.run(['https://www.etsy.com/search?q=wooden%20box']);
//await crawler.run(['https://www.etsy.com']); //works
//await crawler.run(['https://www.amazon.com']); //works
It seems to fail at Checking device, I thought it injected TLS fingerprint and Browser fingperint but it seems Etsy still blocks it with 403!
Thank you!Hall
02/02/2025, 5:04 PMazzouzana
02/02/2025, 7:52 PMbluebeard
02/02/2025, 11:31 PMВан\
02/05/2025, 3:05 PM