-
-
Save AnderRV/8ded72b122114baf8769a70d3652b440 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const playwright = require('playwright'); | |
(async () => { | |
const browser = await playwright.chromium.launch({ | |
proxy: { server: 'http://91.216.164.251:80' }, // Another free proxy from the list | |
}); | |
const context = await browser.newContext(); | |
const page = await context.newPage(); | |
page.setExtraHTTPHeaders({ referrer: 'https://news.ycombinator.com/' }); | |
await page.goto('http://httpbin.org/anything'); | |
console.log(await page.locator('pre').textContent()); // Print the complete response | |
await browser.close(); | |
})(); | |
// "Referrer": "https://news.ycombinator.com/" | |
// "origin": "91.216.164.251" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment