一、环境配置
首先,进行环境安装,作者的python版本为3.10,配置好python版本后,可参考官方文档进行配置
如果不看文档的话也可以照着我的步骤进行安装:
pip install pytest-playwright
playwright install
安装过程比较漫长,耐心等待即可。
验证是否安装成功
playwright -h
若出现以下信息说明安装成功
Usage: playwright [options] [command]
Options:
-V, --version output the version number
-h, --help display help for command
Commands:
open [options] [url] open page in browser specified via -b, --browser
codegen [options] [url] open page and generate code for user actions
install [options] [browser...] ensure browsers necessary for this version of Playwright are installed
unins