Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const { chromium } = require('playwright-extra')
- // Configure and add the proxy router plugin with a default proxy
- const ProxyRouter = require('@extra/proxy-router')
- chromium.use(
- ProxyRouter({
- proxies: { DEFAULT: 'http://user:pass@proxyhost:port' },
- })
- )
- (async () => {
- const browser = await chromium.launch({ headless: true });
- const page = await browser.newPage();
- await page.goto('http://httpbin.io/ip');
- // Get the text content of the page
- const textContent = await page.evaluate(() => document.body.textContent);
- console.log('IP:');
- console.log(textContent);
- await browser.close();
- })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement