Microsoft Playwright Automation Tool

Playwright is a browser automation tool released by the Microsoft team.
Another popular tool similar to it is Selenium. Playwright has a significant advantage in recording and generating code.


pip install playwright
python -m playwright install

Generate code

python -m playwright codegen

We can use –help to see more options.

python -m playwright codegen --help

Usage: index codegen [options] [url]

open page and generate code for user actions

  -o, --output <file name>  saves the generated script to a file
  --target <language>       language to use, one of javascript, python, python-async, csharp (default: "python")
  -h, --help                display help for command


  $ codegen
  $ codegen --target=python
  $ -b webkit codegen

Leave a Reply

Your email address will not be published.