playwright学习的第一天
安装playwright
pip install pytest-playwright
通过playwright安装所需浏览器
playwright install
playwright install chromium 只安装 chromium
录制功能
playwright codegen —默认基于 chromium 浏览器 打开空白页进行录制
执行逻辑解析:
1、创建一个playwright 对象,调用sync_playwright()完成playwright对象的创建
2、基于playwright创建一个browser对象,同时启动浏览器
3、基于浏览器创建一个上下文管理对象(逻辑)—效率跟性能会比较好
4、 基于上下文管理对象创建page对象