Don't use Selenium, use [Playwright](https://playwright.dev/python/): * Playwright automatically sets up headless browsers. * Provides convenient abstractions for locating elements in a page (mostly no XPath required. It can match "intelligently" using text). * Has a handy UI tool that records your actions in a browser and writes equivalent *readable* Playwright code.