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. Further reading: https://new.pythonforengineers.com/blog/web-automation-dont-use-selenium-use-playwright/