-2

I'd like to automate the Tor Browser using Playwright on Python. My question is "What code in the Playwright API runs a different browser than the default web drivers?" overall but more specifically "What is the code to get Playwright to run the Tor browser?"

There are similar questions on Stack Overflow for doing this with Selenium. I'm asking about how to do it with Playwright.

Al Sweigart
  • 11,566
  • 10
  • 64
  • 92

1 Answers1

2

Playwright supports Firefox, but it uses a patched version of Firefox with some customisations to allow for its automation. Because of this, you can't swap out the Playwright version of Firefox with another Firefox build (like the Tor browser) without applying those patches. See related answer

anthony shaw
  • 133
  • 11
  • The patches are applied here https://github.com/microsoft/playwright/blob/main/browser_patches/roll_from_upstream.sh but the directory structure of the Firefox source doesn't match the Tor source, so you've have to manually apply them and compile Tor from source – anthony shaw Jun 29 '23 at 01:46