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://164.132.170.100:80' },
- })
- )
- chromium.launch({ headless: true }).then(async browser => {
- const page = await browser.newPage()
- // Navigate to target URL
- await page.goto('http://httpbin.io/ip');
- // Get page HTML
- const textContent = await page.evaluate(() => document.body.textContent);
- console.log(textContent);
- await browser.close()
- })
- /*
- {
- "origin": "164.132.170.100"
- }
- */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement