码农知识堂 - 1000bd
  •   Python
  •   PHP
  •   JS/TS
  •   JAVA
  •   C/C++
  •   C#
  •   GO
  •   Kotlin
  •   Swift
  • Linux环境phantomjs安装,使用,常见问题


    Linux安装Phantomjs

    我之前写过一篇《SptingBoot基于Echarts生成折线图,柱状图》的文章,不过是基于windows环境的使用与运行的,那Linux环境应该怎么使用Phantomjs呢?

    安装

    • PhantomJS(官方下载) 该超链接为官方下载地址,我们可以根据自己的环境,下载所需的版本或者最新的版本 或者直接在Linux运行
    • 【wget https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-2.1.1-linux-x86_64.tar.bz2 】下载Linux64的压缩包在这里插入图片描述
    • 下载完成后在压缩包所在文件夹下进行解压到当前文件夹下
     tar -xvf phantomjs-2.1.1-linux-x86_64.tar.bz2 
    
    • 1

    在这里插入图片描述

    • 解压完成过,我们进入…/phantomjs-2.1.1-linux-x86_64/bin/文件夹中,将phantomjs执行文件放入/use/bin文件夹下,相当于我们在windows中配置环境变量,从而方便我们运行
    sudo ln -s /phantomjs-2.1.1-linux-x86_64/bin/phantomjs /usr/bin/phantomjs
    
    • 1
    • 完成后,我们进行输入命令 phantomjs -h 如果你发现报错了 (没有报错请跳过)
    root@ai:/home/ai# phantomjs -h
    Auto configuration failed
    140454038030272:error:25066067:DSO support routines:DLFCN_LOAD:could not load the shared library:dso_dlfcn.c:185:filename(libproviders.so): libproviders.so: cannot open shared object file: No such file or directory
    140454038030272:error:25070067:DSO support routines:DSO_load:could not load the shared library:dso_lib.c:244:
    140454038030272:error:0E07506E:configuration file routines:MODULE_LOAD_DSO:error loading dso:conf_mod.c:285:module=providers, path=providers
    140454038030272:error:0E076071:configuration file routines:MODULE_RUN:unknown module name:conf_mod.c:222:module=providers
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6

    这个问题是因为Ubuntu 22.04 使用新的 OpenSSL 版本 3.0.2 而不是旧的 OpenSSL 版本 1.1.1 。这些 OpenSSL 版本不完全向后兼容,所以这就是为什么您在 PhantomJS 尝试自动配置 SSL/TLS 设置时看到此错误的原因。

     export OPENSSL_CONF=/dev/null
    
    • 1

    再次运行phantomjs -h,就恢复正常

    root@ai:/home/ai# phantomjs -h
    Usage:
       phantomjs [switchs] [options] [script] [argument [argument [...]]]
    
    Options:
      --cookies-file=                 Sets the file name to store the persistent cookies
      --config=                       Specifies JSON-formatted configuration file
      --debug=                        Prints additional warning and debug message: 'true' or 'false' (default)
      --disk-cache=                   Enables disk cache: 'true' or 'false' (default)
      --disk-cache-path=              Specifies the location for the disk cache
      。。。。。
    
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 接下来我们运行phantomjs /phantomjs-2.1.1-linux-x86_64/examples/hello.js
    root@ai:/# phantomjs /phantomjs-2.1.1-linux-x86_64/examples/hello.js
    Hello, world!
    
    • 1
    • 2

    输出Hello, world!代表phantomjs 安装成功


    使用可参考:《 ptingBoot基于Echarts生成折线图,柱状图,超详细~~》

  • 相关阅读:
    算法篇:查找算法
    VMware ESXi 8.0 SLIC 2.6 & macOS Unlocker (Oct 2022 GA)
    是时候为Spring Boot 3.0做准备了
    苹果电脑误删除的文件怎么恢复?
    【牛客刷题】——Python入门 07 循环语句(中)
    CI/CD 持续集成与持续交付(1)
    【PyTorch深度学习项目实战100例】—— 基于AlexNet实现宠物小精灵(宝可梦)分类任务 | 第49例
    java毕业设计保险公司管理系统mybatis+源码+调试部署+系统+数据库+lw
    Git使用详解
    代码+视频,R语言对数据进行多重插补后回归分析
  • 原文地址:https://blog.csdn.net/qq1328585964/article/details/127691433
  • 最新文章
  • 攻防演习之三天拿下官网站群
    数据安全治理学习——前期安全规划和安全管理体系建设
    企业安全 | 企业内一次钓鱼演练准备过程
    内网渗透测试 | Kerberos协议及其部分攻击手法
    0day的产生 | 不懂代码的"代码审计"
    安装scrcpy-client模块av模块异常,环境问题解决方案
    leetcode hot100【LeetCode 279. 完全平方数】java实现
    OpenWrt下安装Mosquitto
    AnatoMask论文汇总
    【AI日记】24.11.01 LangChain、openai api和github copilot
  • 热门文章
  • 十款代码表白小特效 一个比一个浪漫 赶紧收藏起来吧!!!
    奉劝各位学弟学妹们,该打造你的技术影响力了!
    五年了,我在 CSDN 的两个一百万。
    Java俄罗斯方块,老程序员花了一个周末,连接中学年代!
    面试官都震惊,你这网络基础可以啊!
    你真的会用百度吗?我不信 — 那些不为人知的搜索引擎语法
    心情不好的时候,用 Python 画棵樱花树送给自己吧
    通宵一晚做出来的一款类似CS的第一人称射击游戏Demo!原来做游戏也不是很难,连憨憨学妹都学会了!
    13 万字 C 语言从入门到精通保姆级教程2021 年版
    10行代码集2000张美女图,Python爬虫120例,再上征途
Copyright © 2022 侵权请联系2656653265@qq.com    京ICP备2022015340号-1
正则表达式工具 cron表达式工具 密码生成工具

京公网安备 11010502049817号