(Session info: chrome=99.0.4844.84) (Driver info: chromedriver=70.0.3538.97

最近碰到了一个非常奇怪的问题,用python2.7的tornado框架搭建web服务,用selenium模块模拟登陆获取数据,放在一个window服务器上

出现的现象是:打开window桌面远程连接,请求接口就能成功返回结果,
关闭远程桌面连接,程序就无法正常获取结果

一开始排查问题的方向错了,怀疑window服务器的远程连接断开会导致系统进入睡眠状态,修改了各种服务器的睡眠配置,远程连接会话状态等设置,程序依然没有正常运行,在多次尝试无果之后,又从代码本身的问题上入手

最终过滤掉其他无关信息之后,真相就很明显了

selenium.common.exceptions.TimeoutException: Message: timeout
NoSuchElementException: Message: no such element: Unable to locate locate element: {"method": "class name","selector": ""}

(Session info: chrome=99.0.4844.84)
(Driver info: chromedriver=70.0.3538.97 (d035916fe243477005bc95fe2a5778b8f20b6ae1),platform=Windows NT 10.0.1439364)

于是下载了对应的Chrome驱动
http://npm.taobao.org/mirrors/chromedriver/
然后就好啦~解决一个问题之后就会很开心

你可能感兴趣的:((Session info: chrome=99.0.4844.84) (Driver info: chromedriver=70.0.3538.97)