使用具有以下功能的代理机构 Playwright

了解如何用Playwright为测试自动化设置驻地和移动代理。
选择计划 3天试用 - 没有设置费用 - 随时取消
定价
Playwright
  1. To use Playwright and set up your proxies you need to paste this code example
     const playwright = require('@playwright/test');
     const launchOptions = {
         proxy: {
             server: 'proxy.froxy.com:9000',
             username: 'login',
             password: 'password'
         }
     };
     (async () => {
         const defaultBrowser = await playwright['chromium'].launch({});
         const context = await defaultBrowser.newContext();
         const page = await context.newPage();
         await page.goto('https://froxy.com/api/detect-ip');
         console.log('chromium without proxy:', await page.textContent("*"));
         await defaultBrowser.close();
    
         for (const browserType of ['chromium', 'firefox', 'webkit']) {
             const browser = await playwright[browserType].launch(launchOptions);
             const context = await browser.newContext();
             const page = await context.newPage();
             try {
                 await page.goto('https://froxy.com/api/detect-ip');
                 console.log(`${browserType} with proxy:`, await page.textContent("*"));
             } catch (e) {
                 console.log(e);
             }
             await browser.close();
         }
     })();
    
  2. Please, add proxy config in playwright.config.ts use section
  3. You can get all information concerning server/port, login and password in your Froxy Dashboard
For additional info you can visit Playwright development portal.

现在就试试Froxy吧

来自Froxy的代理适合最流行的工具,让你实现你的目标!

现在就试试代理,只要创建一个账户,选择一个费率,就可以开始了。

现在开始