首页 > 其他分享 >Playwright运行报错的解决

Playwright运行报错的解决

时间:2023-06-12 14:15:07浏览次数:40  
标签:playwright firefox so.0 Playwright 报错 install 浏览器 安装 运行

未安装浏览器报错

playwright._impl._api_types.Error: Executable doesn't exist at /home/deploy/.cache/ms-playwright/firefox-1403/firefox/firefox
╔════════════════════════════════════════════════════════════╗
║ Looks like Playwright was just installed or updated.       ║
║ Please run the following command to download new browsers: ║
║                                                            ║
║     playwright install                                     ║
║                                                            ║
║ <3 Playwright Team                                         ║
╚════════════════════════════════════════════════════════════╝

这个错误是因为没有安装playwright的浏览器导致的,需要输入以下命令安装浏览器

playwright install
## 或者
python -m playwright install

## 以上命令会安装所有浏览器,如果只需要安装一个浏览器比如firefox
python -m playwright install firefox

未安装依赖报错

playwright._impl._api_types.Error: 
╔══════════════════════════════════════════════════════╗
║ Host system is missing dependencies to run browsers. ║
║ Missing libraries:                                   ║
║     libgtk-3.so.0                                    ║
║     libgdk-3.so.0                                    ║
║     libXcomposite.so.1                               ║
║     libXdamage.so.1                                  ║
║     libXfixes.so.3                                   ║
║     libXrandr.so.2                                   ║
║     libXtst.so.6                                     ║
║     libpangocairo-1.0.so.0                           ║
║     libpango-1.0.so.0                                ║
║     libatk-1.0.so.0                                  ║
║     libcairo-gobject.so.2                            ║
║     libcairo.so.2                                    ║
║     libgdk_pixbuf-2.0.so.0                           ║
║     libXcursor.so.1                                  ║
║     libXi.so.6                                       ║
╚══════════════════════════════════════════════════════╝

这是因为没有安装playwright的依赖导致的问题,可以执行下面的命令来安装

# centos
yum -y install libappindicator-gtk3
yum -y install liberation-fonts

# ubuntu/debian
apt-get install -y gstreamer1.0-libav libnss3-tools libatk-bridge2.0-0 libcups2-dev libxkbcommon-x11-0 libxcomposite-dev libxrandr2 libgbm-dev libgtk-3-0

# ubuntu/debian也可以执行来安装依赖
python -m playwright install --with-deps

标签:playwright,firefox,so.0,Playwright,报错,install,浏览器,安装,运行
From: https://www.cnblogs.com/dingnosakura/p/17474864.html

相关文章

  • [转]POI 解析excel报错 java.lang.NoClassDefFoundError: org/apache/poi/ss/usermode
    前几天做了一个excel上传导入功能,为了通用想同步支持xls和xlsx格式。代码编写期并没有报错,所需要的类也都有。可是应用启动完测式功能的时候报了这么一个错Causedby:java.lang.NoClassDefFoundError:org/apache/poi/ss/usermodel/Date1904Support这是为什么呢?我第一感觉是jar......
  • pytest文档 88- pytest-runtime-yoyo 对用例运行时长断言
    说明pytest执行用例的时候,我们希望对用例的运行时间断言,当用例执行时长大于预期标记此用例失败。@pytest.mark.runtime(1)运行时长单位是秒此插件已打包上传到pypihttps://pypi.org/project/pytest-runtime-yoyo/1.0.0/基本示例test_demo.pyimportpytestimporttime......
  • XXL-JOB手工执行任务报错:msg:xxl-rpc remoting error(Connection refused (Connection
    【问题描述】XXL-JOB手工执行任务报错:msg:xxl-rpcremotingerror(Connectionrefused(Connectionrefused)),forurl  【原因分析】 在xxl-job服务端所在的服务器上面去telnetxxl-job所在的客户端服务器的9986端口,提示拒绝连接:对于端口拒绝连接的问题,应该是网络的问......
  • ABP入门教程4 - 初始化运行
    点这里进入ABP入门教程目录 编译解决方案重新生成解决方案,确保生成成功。连接数据库打开JD.CRS.Web.Host/appsettings.json,修改数据库连接设置ConnectionStrings.打开JD.CRS.Web.Host/appsettings.json,做同样修改.   迁移数据库方法一设置JD.CRS.Web.Mvc为启始项目打开工具/......
  • try……except配合traceback模块,进行不报错异常捕获
    通过try语句去尝试做正确的事,如果中途遭遇了意外情况就引发异常提示try:………………………………………………………………return"成功执行"exceptExceptionase:#Handletheexceptiont......
  • 解决gorm安装报错
    报错:go:modulegrom.io/gorm:Get"https://proxy.golang.org/grom.io/gorm/@v/list":dialtcp142.251.43.17:443:connectex:Aconnectionattemptfailedbecausetheconnectedpartydidnotproperlyrespondafteraperiodoftime,orestablishedconn......
  • windows 安装docker desktop 报错
    安装docker时报错:JSON字符串无效。(异常来自HRESULT:0x83750007)在Windows.Data.Json.JsonValue.Parse(Stringinput)在CommunityInstaller.InstallWorkflow.SetupBackendModeAndFeatures-----------------------------------------------------------------------......
  • springboot+vue留守儿童爱心网站,附源码+数据库+论文+PPT,远程包安装运行
    1、项目介绍留守儿童爱心网站采用了B/S结构,JAVA作为开发语言,数据库采用了B/S结构,Mysql数据库进行开发。该系统包括前台操作,后台由管理员和用户两个部分,一方面,为用户提供首页、宣传新闻、志愿活动、爱心捐赠、个人中心、后台管理等功能;另一方面,为管理员提供首页、个人中心、用户管......
  • [GPT] php 报错 Unsupported operand types
     Unsupportedoperandtypes这个错误通常发生在使用了不支持的操作数类型时。例如,当您尝试对两个不同类型的值执行算术运算时,就会出现这个错误。例如,如果您尝试将字符串与数字相加,则会出现此错误: $number=10;$string="20";$result=$number+$string;//Unsuppo......
  • 将容器中程序复制另一个容器中运行
    在学习和测试过程中,我们可能用用的许多镜像,其实还是比较零散的,要记录dockerrun命令,我曾经想把ubuntu容器当成正常的系统来用,apt安装需要的软件,然后commit提交成镜像。这样,我只要启动这个镜像,啥都有了。后来我发现用到最后,生成的镜像太大了。而且apt安装的软件版本没有......