上一主题 下一主题
ScriptCat,新一代的脚本管理器脚本站,与全世界分享你的用户脚本油猴脚本开发指南教程目录
返回列表 发新帖

nodejs解决seleniutm启动错误

[复制链接]
  • TA的每日心情
    开心
    2023-2-28 23:59
  • 签到天数: 191 天

    [LV.7]常住居民III

    620

    主题

    5084

    回帖

    5958

    积分

    管理员

    非物质文化遗产社会摇传承人

    积分
    5958

    荣誉开发者管理员油中2周年生态建设者喜迎中秋

    发表于 2022-9-20 21:03:08 | 显示全部楼层 | 阅读模式

    IEDriverServer.exe could not be found on the current PATH. Please download the latest version of IEDriverServe balabal
    因为我路径写错了
    C:\Users\god\IEDriverServer.exe
    不小心写成了C:\Users\god\IEDriverServer
    不能携带文件名
    然后提示
    protected Mode settings are not the same for all zones. Enable Protected Mode must be set to the same value (enabled or disabled) for all zones
    参考
    https://blog.csdn.net/huyanyan08/article/details/78459641
    关闭ie安全模式
    打开IE——》设置——》Internet选项——》安全——》去掉启用保护模式前的对勾
    图片.png

    注意

    图片.png
    这里有四个要全关
    推荐安全级别也拉到最低,受限制的不用

    然后跑一个最基本的例子

    const { Builder, By, Key, until} = require("selenium-webdriver");
    
    (async function example() {
      let driver = await new Builder().forBrowser('internet explorer').build(); // 以firefox浏览器为目标构建器
      try {
        await driver.get('http://www.baidu.com');
      } finally {
        await driver.quit();
      }
    })();
    

    运行成功
    图片.png

    结语

    撒花~

    混的人。
    ------------------------------------------
    進撃!永遠の帝国の破壊虎---李恒道

    入驻了爱发电https://afdian.net/a/lihengdao666
    个人宣言:この世界で私に胜てる人とコードはまだ生まれていません。死ぬのが怖くなければ来てください。

    发表回复

    本版积分规则

    快速回复 返回顶部 返回列表