zoukankan      html  css  js  c++  java
  • selenium 访问网页抛出ElementNotVisibleException异常

    问题描述:

    在使用selenium时遇到如下异常导致程序终止:

    selenium.common.exceptions.ElementNotVisibleException: Message: {"errorMessage":"Element is not currently visible and may not be manipulated","request":{"headers":{"Accept":"application/json","Accept-Encoding":"identity","Connection":"close","Content-Length":"81","Content-Type":"application/json;charset=UTF-8","Host":"127.0.0.1:55400","User-Agent":"Python http auth"},"httpVersion":"1.1","method":"POST","post":"{"id": ":wdc:1507345910060", "sessionId": "416c7180-ab0d-11e7-b13e-8162184dcb19"}","url":"/click","urlParsed":{"anchor":"","query":"","file":"click","directory":"/","path":"/click","relative":"/click","port":"","host":"","password":"","user":"","userInfo":"","authority":"","protocol":"","source":"/click","queryKey":{},"chunks":["click"]},"urlOriginal":"/session/416c7180-ab0d-11e7-b13e-8162184dcb19/element/:wdc:1507345910060/click"}}
    Screenshot: available via screen

    解决办法:

    在启动对应浏览器驱动后,添加如下所示深紫色所示内容。(Note:该条语句用于设置窗口显示尺寸规格,最好设置为您当前pc的电脑分辨率

    brower = webdriver.Chrome()

    brower.set_window_size(1920, 1080)

  • 相关阅读:
    iOS 开发学习之 User Interface(2)UIWindow 视窗
    iOS 开发学习之 User Interface(1)APP 生命周期
    OC-学习Tips
    初识Objective-C
    Android代码报错:setContentView(R.layout.activity_main)
    解决Discuz! info: MySQL Query Error
    技术网站
    java调用机器上的shell脚本
    素材网、图片库
    database工具
  • 原文地址:https://www.cnblogs.com/crawer-1/p/7634372.html
Copyright © 2011-2022 走看看