python+playwright 学习-85 启动参数 proxy 设置代理几种方式

前言

在使用playwright执行代码的时候,如需设置代理,可以在启动的时候加proxy 参数设置代理。
本篇总结下可以加proxy代理的几种方式。

launch 启动全局代理

launch 启动的时候设置全局代理,以下是示例

from playwright.sync_api import Playwright, sync_playwright


with sync_playwright() as playwright:
    browser = playwright.chromium.launch(
        headless=False

你可能感兴趣的:(playwright,python,开发语言)