selenium 4 raises exception without useful message

selenium 4 raises exception

example code:

python 复制代码
driver = webdriver.Chrome()
driver.get("http://www.python.org")
assert "Python" in driver.title
elem = driver.find_element_by_name("q")
elem.clear()
elem.send_keys("pycon")
elem.send_keys(Keys.RETURN)
assert "No results found." not in driver.page_source
driver.close()

issue log:

复制代码
Traceback (most recent call last):
...
File "C:\Users\AppData\Local\Programs\Python\Python312\Lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 193, in check_response
    raise exception_class(value)
selenium.common.exceptions.WebDriverException: Message:

investigation:

Run below code:

python 复制代码
from selenium import webdriver
import logging

logging.basicConfig(level=logging.DEBUG)

def main() -> int:
    browser = webdriver.Firefox()
    browser.get('http://selenium.dev/')
    return 0
    
if __name__ == "__main__":
    raise SystemExit(main())

From the output, it shows something related to proxy.

solution:

  • downgrade to selenium 3.14.1
  • remove proxy in environment variable

github issue

相关推荐
半路_出家ren4 小时前
流量抓取工具(wireshark)
网络·网络协议·测试工具·网络安全·wireshark·流量抓取工具
猿周LV5 小时前
JMeter 安装及使用 [软件测试工具]
java·测试工具·jmeter·单元测试·压力测试
西柚小萌新19 小时前
【Python爬虫基础篇】--4.Selenium入门详细教程
爬虫·python·selenium
??? Meggie1 天前
Selenium 怎么加入代理IP,以及怎么检测爬虫运行的时候,是否用了代理IP?
爬虫·tcp/ip·selenium
天才测试猿1 天前
软件测试之功能测试详解
自动化测试·软件测试·python·功能测试·测试工具·职场和发展·测试用例
HtwHUAT1 天前
五、web自动化测试01
前端·css·chrome·python·功能测试·selenium·html
远方2351 天前
应用信息1.13.0发布
测试工具·安全·apk·开发工具·应用·工具·信息
珠峰下的沙砾1 天前
如何在 Postman 中,自动获取 Token 并将其赋值到环境变量
测试工具·lua·postman
桑榆非婉2 天前
同样的接口用postman/apifox能跑通,用jmeter跑就报错500
测试工具·jmeter·postman
苍煜2 天前
Jsoup、Selenium 和 Playwright 的含义、作用和区别
python·selenium·测试工具