在使用playwright执行代码的时候,如需设置代理,可以在启动的时候加proxy 参数设置代理。
本篇总结下可以加proxy代理的几种方式。
launch 启动的时候设置全局代理,以下是示例
from playwright.sync_api import Playwright, sync_playwright
with sync_playwright() as playwright:
browser = playwright.chromium.launch(
headless=False