Skip to content
This repository has been archived by the owner on Jun 19, 2023. It is now read-only.

MeiK2333/headful-chrome-launch

Repository files navigation

headful-crawler

Run

Dev

ts-node src/app.ts

Docker

docker pull meik2333/headful-chrome-launch
docker run --rm -it -p 5678:5678 -p 5900:5900 meik2333/headful-chrome-launch

Example

Playwright

import playwright from 'playwright';
(async () => {
  const browser = await playwright.firefox.connect({ wsEndpoint: 'ws://127.0.0.1:5678/firefox?proxy.username=username&proxy.password=password&proxy.server=http://ip:port&args=--window-size=1920,1080&args=--user-agent=fake' }); // Or 'webkit' or 'firefox'
  const context = await browser.newContext();
  const page = await context.newPage();
  await page.goto('https://httpbin.org/get');
  await page.screenshot({ path: `example.png` });
  await browser.close()
})();

Puppeteer

import puppeteer from 'puppeteer';
(async () => {
  const browser = await puppeteer.connect({ browserWSEndpoint:  'ws://127.0.0.1:5678/chrome?proxy.username=username&proxy.password=password&proxy.server=http://ip:port&args=--window-size=1920,1080&args=--user-agent=fake' });
  const page = await browser.newPage();
  await page.goto('https://httpbin.org/get');
  await page.screenshot({ path: `example.png` });
  await browser.close()
})();

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published