Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
490 views
in Technique[技术] by (71.8m points)

selenium chromedriver and chrome binary wont connect even they match versions

First: I have been working with selenium for some time now, and I am NOT a newbie here - nevertheless I have encountered an issue that I just can't solve for some hidden reason... I am on ubuntu 20.04 and I have downloaded chrome beta + chromedriver with exact same version + created webdriver with chrome path + chromedriver path specified as follows:

chrome_options = webdriver.ChromeOptions()
chrome_options.add_argument("--headless")
chrome_options.add_argument("--remote-debugging-port=9222")
chrome_options.add_argument("--no-sandbox")
chrome_options.add_argument("--disable-setuid-sandbox")
chrome_options.binary_location = google_chrome_beta_bin
prefs = {"profile.managed_default_content_settings.images": 2}
chrome_options.add_experimental_option("prefs", prefs)
selenium_driver = webdriver.Chrome(options=chrome_options, executable_path=chrome_driver_bin)

I get the following exception:

Message: session not created
from disconnected: unable to connect to renderer

Any clue what is wrong here? Chrome beta about dialog says it's version 88.... and chromedriver was downloaded for that specific version, still I get this error. Did work for 87...

question from:https://stackoverflow.com/questions/65646954/selenium-chromedriver-and-chrome-binary-wont-connect-even-they-match-versions

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

That was quick :)

removing the debugging port solved the issue. Previously / on windows machine - it worked. In fact setting the remote-debugging-port was recommended as solution to another bug.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...