Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const puppeteer = require('puppeteer');
- (async () => {
- // specify the proxy server
- const proxyServer = 'http://20.219.176.57:3129';
- // launch Puppeteer with the proxy
- const browser = await puppeteer.launch({
- args: [`--proxy-server=${proxyServer}`],
- });
- // open a new page
- const page = await browser.newPage();
- // navigate to a website to check the IP (httpbin.org in this case)
- await page.goto('http://httpbin.org/ip');
- // get the HTML text content
- const htmlTextContent = await page.evaluate(() => document.body.textContent);
- // log only the HTML text content
- console.log(htmlTextContent);
- // close the browser
- await browser.close();
- })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement