近期用 Selenium 在沒有更新任何源碼的情況,再次執行後遇到以下錯誤:
Starting ChromeDriver 2.23.409699 (49b0fa931cda1caad0ae15b7d1b68004acd05129) on port 21975 Only local connections are allowed. 十一月 04, 2016 1:55:08 下午
org.openqa.selenium.remote.ProtocolHandshake createSession
資訊: Attempting bi-dialect session, assuming Postel's Law holds true on the remote end 十一月 04, 2016 1:55:10 下午 org.openqa.selenium.remote.ProtocolHandshake createSession 資訊: Detected dialect: OSS Exception in thread "main" org.openqa.selenium.NoSuchSessionException: no such session (Driver info: chromedriver=2.23.409699 (49b0fa931cda1caad0ae15b7d1b68004acd05129),platform=Windows NT 6.1.7601 SP1 x86_64) (WARNING: The server did not provide any stacktrace information) Command duration or timeout: 4 milliseconds Build info: version: '3.0.0-beta4', revision: '3169782', time: '2016-09-29 10:30:04 -0700'
解法是要將 ChromeDriver 2.23 更新到 2.25 即可,不過這點還滿弔詭的,因為我個人並沒有更動到任何既有源碼或更新 Selenium 套件,代表 ChromeDriver 本身一定有做一些檢查,這點有空再來研究。
[額外資訊]
- ChromeDriver載點:https://sites.google.com/a/chromium.org/chromedriver/downloads