Chromedriver for chrome version 65 - selenium-chromedriver

I am working on py script with selenium for taking screenshot of web page from Chrome browser version 65. I cant find compatible Chromedriver for this chrome version 65 in official website.
I used chromedriver version for 71 (oldest available chromedriver)and it threw this error
File "selenium\webdriver\chrome\webdriver.py", line 81, in __init__
File "selenium\webdriver\remote\webdriver.py", line 157, in __init__
File "selenium\webdriver\remote\webdriver.py", line 252, in start_session
File "selenium\webdriver\remote\webdriver.py", line 321, in execute
File "selenium\webdriver\remote\errorhandler.py", line 242, in check_response
selenium.common.exceptions.SessionNotCreatedException: Message: session not created: Chrome version must be between 71 and 75
(Driver info: chromedriver=2.46.628402)
Where can i download driver for chrome version 65. Or any other option to fix this error. Please help. Thanks.

I believe you could try ChromeDriver 2.36, but it is outdated, and may not work. => https://chromedriver.storage.googleapis.com/index.html?path=2.36/. According to the notes, the ChromeDriver Supports Chrome v63-65.

Related

Java heap space error in TypeDB when importing CSV files

I tried to import some CSV files into my TypeDB schema using Python and got the following error.
Traceback (most recent call last):
File "C:\Users\panxx006\Desktop\test\migrate.py", line 65, in <module>
build_test_graph(inputs=inputs)
File "C:\Users\panxx006\Desktop\test\migrate.py", line 9, in build_test_graph
load_data_into_typedb(input, session)
File "C:\Users\panxx006\Desktop\test\migrate.py", line 21, in load_data_into_typedb
transaction.commit()
File "C:\Users\panxx006\AppData\Local\Programs\Python\Python39\lib\site-packages\typedb\connection\transaction.py", line 95, in commit
self.execute(transaction_commit_req())
File "C:\Users\panxx006\AppData\Local\Programs\Python\Python39\lib\site-packages\typedb\connection\transaction.py", line 80, in execute
return self.run_query(request, batch).get()
File "C:\Users\panxx006\AppData\Local\Programs\Python\Python39\lib\site-packages\typedb\stream\bidirectional_stream.py", line 136, in get
return self._stream.fetch(self._request_id)
File "C:\Users\panxx006\AppData\Local\Programs\Python\Python39\lib\site-packages\typedb\stream\bidirectional_stream.py", line 84, in fetch
raise error
typedb.common.exception.TypeDBClientException: Java heap space
Please check server logs for the stack trace.
Could you please tell me the way to fix this error? I'm using TypeDB 2.6.3
Upgrading your version of TypeDB to the latest version will help solve this error. As of writing, TypeDB 2.13.0 is the newest version, which includes a number of improvements to memory usage so you should see fewer errors of this kind in the future.
You can download the latest version of TypeDB from the releases page on GitHub: https://github.com/vaticle/typedb/releases
Full disclosure: I work for Vaticle, the creators of TypeDB.

Selenium python library via docker, Chrome error failed to start: exited abnormally

I am trying to run some python scripts with the selenium library from within a docker container based on miniconda/anaconda, but I keep getting this error: selenium.common.exceptions.WebDriverException: Message: unknown error: Chrome failed to start: exited abnormally. I am also using a python wrapper for xvfb to avoid opening a real Chrome window.
To reproduce this (from a running docker container):
root#304ccd3bae83:/opt# python
Python 3.6.4 |Anaconda, Inc.| (default, Jan 16 2018, 18:10:19)
[GCC 7.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>
>>>
>>> from selenium import webdriver
>>> from xvfbwrapper import Xvfb
>>>
>>> with Xvfb(width=1366, height=768) as xvfb:
... my_driver = webdriver.Chrome('/opt/chromedriver/2.33/chromedriver')
...
Traceback (most recent call last):
File "<stdin>", line 2, in <module>
File "/opt/conda/lib/python3.6/site-packages/selenium/webdriver/chrome/webdriver.py", line 69, in __init__
desired_capabilities=desired_capabilities)
File "/opt/conda/lib/python3.6/site-packages/selenium/webdriver/remote/webdriver.py", line 151, in __init__
self.start_session(desired_capabilities, browser_profile)
File "/opt/conda/lib/python3.6/site-packages/selenium/webdriver/remote/webdriver.py", line 240, in start_session
response = self.execute(Command.NEW_SESSION, parameters)
File "/opt/conda/lib/python3.6/site-packages/selenium/webdriver/remote/webdriver.py", line 308, in execute
self.error_handler.check_response(response)
File "/opt/conda/lib/python3.6/site-packages/selenium/webdriver/remote/errorhandler.py", line 194, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: unknown error: Chrome failed to start: exited abnormally
(Driver info: chromedriver=2.33.506092 (733a02544d189eeb751fe0d7ddca79a0ee28cce4),platform=Linux 4.4.0-116-generic x86_64)
According to this: https://sites.google.com/a/chromium.org/chromedriver/help/chrome-doesn-t-start it seems someone may need to use a stand-alone version of Chrome that works for all users, but I am not sure how the docker build works, I guess the docker image is built as root, and all the code inside it is executed as root, so there should not be any issue with different users controlling Chrome.
This python code works fine on a normal Ubuntu laptop with X windows. I need to carefully pick both the versions of Chrome and chromedriver, at the moment when checking from within the running docker container:
root#304ccd3bae83:/opt# /opt/chromedriver/2.33/chromedriver --version
ChromeDriver 2.33.506092 (733a02544d189eeb751fe0d7ddca79a0ee28cce4)
root#304ccd3bae83:/opt# google-chrome-stable --version
Google Chrome 62.0.3202.75
These options helped solving the issue.
chrome_options.add_argument('--headless')
chrome_options.add_argument('--no-sandbox')
chrome_options.add_argument("--disable-setuid-sandbox")
One of them is needed when seeing Chrome failed to start: crashed.
Also: make sure there are no zombies (from previous executions) for the chrome-driver process using ps aux | grep chrome-driver to find the PIDs to kill.
Bare in mind that if you are using the Python multiprocessing library to spawn many processes involving their own instance of the Chrome browser, then you can not use Docker (which is supposed to start just one Python process, unless using stuff like supervisor), so you may see: selenium.common.exceptions.WebDriverException: Message: chrome not reachable if you try anyway.

Chrome 59 hangs with --headless and --proxy-server flag

So now that Chrome 59 has headless support
and a proper driver for it (Chromedriver 2.30),
I tried migrating my code to it.
--headless flag works by itself.
--proxy-server flag works by itself, however
combining the two hangs the browser.
Is there a workaround for it?
Env:
- Chrome 59
- Chromedriver 2.30
- selenium 2.46.0
Code:
from selenium import webdriver
chop = webdriver.ChromeOptions()
chop.add_argument("--headless")
chop.add_argument("--proxy-server=socks5://127.0.0.1:8080")
d = webdriver.Chrome(chrome_options=chop)
print("done")
d.get('http://ipinfo.io')
print(d.page_source)
Traceback:
Traceback (most recent call last):
File "t.py", line 5, in <module>
d = webdriver.Chrome(chrome_options=chop)
File "/home/t/env/lib/python3.5/site-packages/selenium/webdriver/chrome/webdriver.py", line 68, in __init__
keep_alive=True)
File "/home/t/env/lib/python3.5/site-packages/selenium/webdriver/remote/webdriver.py", line 89, in __init__
self.start_session(desired_capabilities, browser_profile)
File "/home/t/env/lib/python3.5/site-packages/selenium/webdriver/remote/webdriver.py", line 138, in start_session
'desiredCapabilities': desired_capabilities,
File "/home/t/env/lib/python3.5/site-packages/selenium/webdriver/remote/webdriver.py", line 195, in execute
self.error_handler.check_response(response)
File "/home/t/env/lib/python3.5/site-packages/selenium/webdriver/remote/errorhandler.py", line 170, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: unknown error: Chrome failed to start: exited abnormally
(Driver info: chromedriver=2.30.477691 (6ee44a7247c639c0703f291d320bdf05c1531b57),platform=Linux 4.4.0-21-generic x86_64)
This bug has been resolved.
I just tested it with the follow setup:
Ubuntu 16.04 64 bit
Google Chrome 61.0.3163.59 beta (official release still hangs atm;)
Selenium 3.5.0
ChromeDriver 2.31
No more xvfb required.
I am a happy man today.

selenium.common.exceptions.WebDriverException: Message: Service

I had a trouble when i use selenium to control my Chrome.
Here is my code:
from selenium import webdriver
driver = webdriver.Chrome()
When i tried to operate it ,it runs successfully at first,the Chrome pop on the screen. However, it shut down at the few seconds.
Traceback (most recent call last):
File "<pyshell#3>", line 1, in <module>
driver = webdriver.Chrome('C:\Program Files (x86)\Google\Chrome\chrome.exe')
File "C:\Users\35273\AppData\Local\Programs\Python\Python35\lib\site-packages\selenium\webdriver\chrome\webdriver.py", line 62, in __init__
self.service.start()
File "C:\Users\35273\AppData\Local\Programs\Python\Python35\lib\site-packages\selenium\webdriver\common\service.py", line 86, in start
self.assert_process_still_running()
File "C:\Users\35273\AppData\Local\Programs\Python\Python35\lib\site-packages\selenium\webdriver\common\service.py", line 99, in assert_process_still_running
% (self.path, return_code)
selenium.common.exceptions.WebDriverException: Message: Service C:\Program Files (x86)\Google\Chrome\chrome.exe unexpectedly exited. Status code was: 0
You need to provide the path of chromedriver...download from http://chromedriver.storage.googleapis.com/index.html?path=2.24/...unzip it and provide path to it in... webdriver.chrome ("path to chromedriver")
I explain the things here:
from selenium import webdriver
driver = webdriver.Chrome("C:\Program Files (x86)\Google\Chrome\Application\chrome.exe")
This is the error if i run the above code:
C:\Python27\python.exe C:/Users/Gaurav.Gaurav-PC/PycharmProjects/Learning/StackOverflow/SeleniumQuestion/test123.py
Traceback (most recent call last):
File "C:/Users/Gaurav.Gaurav-PC/PycharmProjects/Learning/StackOverflow/SeleniumQuestion/test123.py", line 4, in <module>
driver = webdriver.Chrome("C:\Program Files (x86)\Google\Chrome\Application\chrome.exe")
File "C:\Python27\lib\site-packages\selenium\webdriver\chrome\webdriver.py", line 62, in __init__
self.service.start()
File "C:\Python27\lib\site-packages\selenium\webdriver\common\service.py", line 86, in start
self.assert_process_still_running()
File "C:\Python27\lib\site-packages\selenium\webdriver\common\service.py", line 99, in assert_process_still_running
% (self.path, return_code)
selenium.common.exceptions.WebDriverException: Message: Service C:\Program Files (x86)\Google
\Chrome\Application\chrome.exe unexpectedly exited. Status code was: 0
Which is same as mentioned by #Weiziyoung in original problem.
The solution is as I mentioned you need to provide the path to chromedriver in place of chrome browser like
driver = webdriver.Chrome("E:\Jars\chromedriver.exe")
It will resolve the problem
Download the appropriate driver:http://chromedriver.storage.googleapis.com/index.html
turn up E:\Python37\Scripts <--Paste the chromedriver.exe file in
i faced the same error (behave.step_registry.AmbiguousStep: #given('Lunch chrome Browser') has already been defined in existing step #given('Lunch chrome Browser') at features/steps/OrangeHRMlogin.py:4). i think it takes previous program where it mentioned "Lunch chrome browser". so i did some changes like in 2nd program i cahnged at (U'chrome browser').change the browser name or the Phase and it runs successfully.
the original chrome browser is opened instead of chrome driver that's the reason of that error download chrome driver and give it's path

Error "cannot find Chrome binary" in windows 8 AMD64 while trying to launch selenium web-driver API

I'm currently working with Chrome extension of selenium web-driver in windows 8 AMD64. I got an issue launching Chrome; It gives me this:
Traceback (most recent call last):
File "D:/java/code/SVN/OMC/trunk/Test/Scripts/PMS\elements\UILoader.py", line 164, in __init__
self.driver = webdriver.Chrome(executable_path="F:\\driver\\chromedriver.exe")
File "C:\Python27\lib\site-packages\selenium-2.42.1-py2.7.egg\selenium\webdriver\chrome\webdriver.py", line 65, in __init__
keep_alive=True)
File "C:\Python27\lib\site-packages\selenium-2.42.1-py2.7.egg\selenium\webdriver\remote\webdriver.py", line 73, in __init__
self.start_session(desired_capabilities, browser_profile)
File "C:\Python27\lib\site-packages\selenium-2.42.1-py2.7.egg\selenium\webdriver\remote\webdriver.py", line 121, in start_session
'desiredCapabilities': desired_capabilities,
File "C:\Python27\lib\site-packages\selenium-2.42.1-py2.7.egg\selenium\webdriver\remote\webdriver.py", line 173, in execute
self.error_handler.check_response(response)
File "C:\Python27\lib\site-packages\selenium-2.42.1-py2.7.egg\selenium\webdriver\remote\errorhandler.py", line 164, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: u'unknown error: cannot find Chrome binary\n (Driver info: chromedriver=2.9.248315,platform=Windows NT 6.2 x86_64)'
I also have put IEDriverServer.exe in the same path and it works fine; this path has been added to the system PATH. I also tried to launch it from another computer with windows 7 AMD64 and it works fine there.
I googled a bit and I saw this; but when I checked the path it specified for chrome.exe, I couldn't find the executable file for chrome. I tried to update Google Chrome, but it gave me error code 1.
I also tried this:
opts = webdriver.ChromeOptions()
opts.binary_location(value = "C:\\WebDrivers\\chromedriver.exe")
driver = webdriver.Chrome(chrome_options = opts)
What should I do?
The last line of the error is the important one:
selenium.common.exceptions.WebDriverException: Message: u'unknown error: cannot find Chrome binary\n (Driver info: chromedriver=2.9.248315,platform=Windows NT 6.2 x86_64)'
The ChromeDriver has been found, and it is reporting that it cannot find the chrome browser executable. Make sure that is installed and on the current path. Some additional information is on the Selenium Wiki.
I solved the problem using ChromeOptions; I addressed the chrome's binary file from ProgramFiles directory. This is the code I used:
opts = webdriver.ChromeOptions()
opts.binary_location(value = "C:\\ProgramFiles\\Google\\Chrome\\chrome.exe")
driver = webdriver.Chrome(chrome_options = opts)
for me it was
opts = webdriver.ChromeOptions()
opts.binary_location = "path/to/Chrome.exe"
driver = webdriver.Chrome(chrome_options=opts)
which fixed the problem
you must set the executable_path where you install the chrome,this is ruby style.python may be the same in my opinion.
Selenium::WebDriver::Chrome::Service.executable_path="D:/Program Files (x86)/Chrome/chrome.exe"