selenium_error

selenium.common.exceptions.WebDriverException: Message: unknown error: unsupported protocol

问题背景:在发起js请求后报错    <GET javascript:sdsHelp('120-1840-000-ND');>

错误代码

browser.get(url)

解决办法

browser.execute_script("window.location.replace('{}');".format(url))

 参考链接

https://stackoverflow.com/questions/54539195/selenium-run-javascript-via-navbar-using-chromedriver?noredirect=1&lq=1

 

posted @ 2019-07-15 10:41  争-渡  阅读(184)  评论(0)    收藏  举报