You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: examples/cdp_mode/playwright/ReadMe.md
+67Lines changed: 67 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -139,6 +139,73 @@ with sync_playwright() as p:
139
139
sb.sleep(3)
140
140
```
141
141
142
+
--------
143
+
144
+
### 🎭 Proxy with auth in <btranslate="no">Stealthy Playwright Mode</b>:
145
+
146
+
To use an authenticated proxy in Stealthy Playwright Mode, **do these two things**:<br />**1.** Set the`proxy` arg when launching Chrome.
147
+
-- Eg: `sb_cdp.Chrome(proxy="USER:PASS@IP:PORT")` or `cdp_driver.start_async("USER:PASS@IP:PORT")`.<br />**2.** Open the URL with SeleniumBase **before** using `endpoint_url` to connect to the browser with Playwright.
148
+
149
+
⚠️ If any trouble with the above, set `use_chromium=True` so that you can use the base Chromium browser, which still allows extensions, unlike regular branded Chrome, which removed the `--load-extension` command-line switch. (*An extension is used to set the auth for the proxy, which is needed when CDP can't set the proxy alone, such as for navigation after the initial page load*).
150
+
151
+
In the sync format, use `sb.open(url)` to open the url before connecting Playwright:
Here's an example of using an authenticated proxy with Stealthy Playwright Mode:<br />(The URL is opened before attaching Playwright so that proxy settings take effect)
0 commit comments