主要有两种方式去安装playwright:
一,如果使用的是anaconda环境,则可以使用“conda install playwright”来安装playwright;使用“playwright install”来安装浏览器(值得一提的是playwright不需要单独安装浏览器驱动webdriver)
上述命令在确保配置好环境变量的情况下,在命令提示符(cmd)里输入后按回车即可自动下载。
笔者推荐使用此命令进行安装,我由于使用anaconda环境,同时使用的是pip安装,导致安装的包单独在c盘系统盘,而与其他第三方包位置不一样。
conda install playwright
playwright install
二,也可以使用“pip install playwright”安装playwright,使用“playwright install”安装浏览器
pip install playwright
playwright install
(以上截图来源于playwright官网)