This version of ChromeDriver only supports Chrome version 102
I'm using VS Code and Anaconda3. Currently trying to install ChromeDriver_Binary but, when I try to execute code, I get this error:
selenium.common.exceptions.SessionNotCreatedException: Message: session not created: This version of ChromeDriver only supports Chrome version 102
Current browser version is 100.0.4896.127 with binary path C:\Program Files (x86)\Google\Chrome\Application\chrome.exe
2 answers
-
answered 2022-05-04 10:23
Angel Wang
I fixed it, by updating chrome to version 101, downloading chromedriver from https://chromedriver.chromium.org/downloads and rebooting.
-
answered 2022-05-05 07:41
misantroop
One option is to use chromedriver-autoinstaller to do it all at once:
import chromedriver_autoinstaller as chr chr.install()
Alternatively use chromedriver-binary-auto to find the required version and install the driver:
pip install --upgrade --force-reinstall chromedriver-binary-auto import chromedriver_binary
No restarting is required.
do you know?
how many words do you know
See also questions close to this topic
-
Python File Tagging System does not retrieve nested dictionaries in dictionary
I am building a file tagging system using Python. The idea is simple. Given a directory of files (and files within subdirectories), I want to filter them out using a filter input and tag those files with a word or a phrase.
If I got the following contents in my current directory:
data/ budget.xls world_building_budget.txt a.txt b.exe hello_world.dat world_builder.spec
and I execute the following command in the shell:
py -3 tag_tool.py -filter=world -tag="World-Building Tool"
My output will be:
These files were tagged with "World-Building Tool": data/ world_building_budget.txt hello_world.dat world_builder.spec
My current output isn't exactly like this but basically, I am converting all files and files within subdirectories into a single dictionary like this:
def fs_tree_to_dict(path_): file_token = '' for root, dirs, files in os.walk(path_): tree = {d: fs_tree_to_dict(os.path.join(root, d)) for d in dirs} tree.update({f: file_token for f in files}) return tree
Right now, my dictionary looks like this:
key:''
.In the following function, I am turning the empty values
''
into empty lists (to hold my tags):def empty_str_to_list(d): for k,v in d.items(): if v == '': d[k] = [] elif isinstance(v, dict): empty_str_to_list(v)
When I run my entire code, this is my output:
hello_world.dat ['World-Building Tool'] world_builder.spec ['World-Building Tool']
But it does not see
data/world_building_budget.txt
. This is the full dictionary:{'data': {'world_building_budget.txt': []}, 'a.txt': [], 'hello_world.dat': [], 'b.exe': [], 'world_builder.spec': []}
This is my full code:
import os, argparse def fs_tree_to_dict(path_): file_token = '' for root, dirs, files in os.walk(path_): tree = {d: fs_tree_to_dict(os.path.join(root, d)) for d in dirs} tree.update({f: file_token for f in files}) return tree def empty_str_to_list(d): for k, v in d.items(): if v == '': d[k] = [] elif isinstance(v, dict): empty_str_to_list(v) parser = argparse.ArgumentParser(description="Just an example", formatter_class=argparse.ArgumentDefaultsHelpFormatter) parser.add_argument("--filter", action="store", help="keyword to filter files") parser.add_argument("--tag", action="store", help="a tag phrase to attach to a file") parser.add_argument("--get_tagged", action="store", help="retrieve files matching an existing tag") args = parser.parse_args() filter = args.filter tag = args.tag get_tagged = args.get_tagged current_dir = os.getcwd() files_dict = fs_tree_to_dict(current_dir) empty_str_to_list(files_dict) for k, v in files_dict.items(): if filter in k: if v == []: v.append(tag) print(k, v) elif isinstance(v, dict): empty_str_to_list(v) if get_tagged in v: print(k, v)
-
Actaully i am working on a project and in it, it is showing no module name pip_internal plz help me for the same. I am using pycharm(conda interpreter
File "C:\Users\pjain\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 196, in _run_module_as_main return _run_code(code, main_globals, None, File "C:\Users\pjain\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 86, in _run_code exec(code, run_globals) File "C:\Users\pjain\AppData\Local\Programs\Python\Python310\Scripts\pip.exe\__main__.py", line 4, in <module> File "C:\Users\pjain\AppData\Local\Programs\Python\Python310\lib\site-packages\pip\_internal\__init__.py", line 4, in <module> from pip_internal.utils import _log
I am using pycharm with conda interpreter.
-
Looping the function if the input is not string
I'm new to python (first of all) I have a homework to do a function about checking if an item exists in a dictionary or not.
inventory = {"apple" : 50, "orange" : 50, "pineapple" : 70, "strawberry" : 30} def check_item(): x = input("Enter the fruit's name: ") if not x.isalpha(): print("Error! You need to type the name of the fruit") elif x in inventory: print("Fruit found:", x) print("Inventory available:", inventory[x],"KG") else: print("Fruit not found") check_item()
I want the function to loop again only if the input written is not string. I've tried to type return Under print("Error! You need to type the name of the fruit") but didn't work. Help
-
It won't let me run selenium code in IntellJ all of a sudden
I was going to execute my code, which is the one I always execute every day for my tests, but suddenly this error appears and I have hardly found a solution, I don't know if it is possible that you can help me with that, I attach the response from the console
Starting ChromeDriver 102.0.5005.27 (df4a85108ffad4dca2c409c52f24df7ec0204b91-refs/branch-heads/5005_22@{#4}) on port 33567 Only local connections are allowed. Please see https://chromedriver.chromium.org/security-considerations for suggestions on keeping ChromeDriver safe. ChromeDriver was started successfully. Exception in thread "main" org.openqa.selenium.SessionNotCreatedException: session not created: This version of ChromeDriver only supports Chrome version 102 Current browser version is 101.0.4951.54 with binary path C:\Program Files\Google\Chrome\Application\chrome.exe Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:17:03' System info: host: 'DESKTOP-V4H61F7', ip: '192.168.56.1', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '17.0.2' Driver info: driver.version: ChromeDriver remote stacktrace: Backtrace: Ordinal0 [0x003B2733+2434867] Ordinal0 [0x003407A1+1968033] Ordinal0 [0x0022C678+837240] Ordinal0 [0x0024CAC3+969411] Ordinal0 [0x002486DA+952026] Ordinal0 [0x00245F91+941969] Ordinal0 [0x002790B0+1151152] Ordinal0 [0x00278D0A+1150218] Ordinal0 [0x00274256+1131094] Ordinal0 [0x0024E840+976960] Ordinal0 [0x0024F736+980790] GetHandleVerifier [0x00623C72+2515426] GetHandleVerifier [0x0061702F+2463135] GetHandleVerifier [0x0045522A+620442] GetHandleVerifier [0x00454016+615814] Ordinal0 [0x0034707B+1994875] Ordinal0 [0x0034B938+2013496] Ordinal0 [0x0034BA25+2013733] Ordinal0 [0x00354DE1+2051553] BaseThreadInitThunk [0x7632FA29+25] RtlGetAppContainerNamedObjectPath [0x77E87A7E+286] RtlGetAppContainerNamedObjectPath [0x77E87A4E+238] at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:77) at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499) at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:480) at org.openqa.selenium.remote.W3CHandshakeResponse.lambda$errorHandler$0(W3CHandshakeResponse.java:62) at org.openqa.selenium.remote.HandshakeResponse.lambda$getResponseFunction$0(HandshakeResponse.java:30) at org.openqa.selenium.remote.ProtocolHandshake.lambda$createSession$0(ProtocolHandshake.java:126) at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197) at java.base/java.util.Spliterators$ArraySpliterator.tryAdvance(Spliterators.java:1002) at java.base/java.util.stream.ReferencePipeline.forEachWithCancel(ReferencePipeline.java:129) at java.base/java.util.stream.AbstractPipeline.copyIntoWithCancel(AbstractPipeline.java:527) at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:513) at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499) at java.base/java.util.stream.FindOps$FindOp.evaluateSequential(FindOps.java:150) at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) at java.base/java.util.stream.ReferencePipeline.findFirst(ReferencePipeline.java:647) at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:128) at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:74) at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:136) at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:83) at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:552) at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:213) at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:131) at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:181) at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:168) at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:123) at Selenium.pruebas_activity21.main(CrearOT.java:28) Process finished with exit code 1
I hope you can help me with it. It doesn't say any relevant changes, but it seems that any code I'm trying to do can no longer be executed.
-
Selenium Python - loop gets slower everytime
Im trying to automize downloading files, from a list of "cars" then save the file on my computer unzip it and rename it with the name of the car.
Problem is, my forloop is getting increasingly slower. The first loop takes about 1 second to execute, but the 10th loop takes almost a minute.
Could someone review my code and point out potential flaws? i'm using chromedriver.
for car in carList: try: #Apre il filter filter = WebDriverWait(driver, 10).until( EC.element_to_be_clickable((By.XPATH, '//*[contains(text(), "filter")]')) ) filter.click() #Find car n_sport = WebDriverWait(driver, 10).until( EC.presence_of_element_located((By.CSS_SELECTOR, '#door')) ) n_sport.send_keys(car) n_sport.send_keys(Keys.ENTER) #open_car = driver.find_element_by_xpath("//a[contains(@title," + "0" +car +")]") open_car = WebDriverWait(driver, 30).until( EC.element_to_be_clickable((By.XPATH, "//a[contains(@title," + "0" +car +")]") )) open_car.click() ##driver.execute_script("arguments[0].click();", checkbox_elem) #open file system fs = WebDriverWait(driver, 30).until( EC.element_to_be_clickable((By.XPATH, '//*[contains(text(), "file system")]')) ) fs.click() #open C: c = WebDriverWait(driver, 60).until( EC.element_to_be_clickable((By.XPATH, '//*[contains(text(), "C:")]')) ) c.click() #Right click on file: f = WebDriverWait(driver, 60).until( EC.element_to_be_clickable((By.XPATH, textToSearch)) ) ActionChains(driver).context_click(f).perform() #Save save = WebDriverWait(driver, 10).until( EC.element_to_be_clickable((By.XPATH, '//*[contains(@href, "#GETFILE")]')) ) save.click() #Find empty button: empty = WebDriverWait(driver, 10).until( EC.element_to_be_clickable((By.XPATH, '//*[contains(text(), "Svuota elenco")]')) ) #Empty empty.click() print('The file has been downloaded from the car: ' + car ) if doesZipExists: renameFile(parentFolder, ext, car, fname) except: print('Error: car ' + car + ' has not been found')
-
Selenium C# - Recording how chrome driver do a test case
At this moment, in my tests I use Screenshots to locate where my test failed.. Screenshot is only taken while, test fails. Sometimes it is difficult to find a place where the test failed exactly. That's why I am thinking about start recording chrome driver's work. I could take failed tests, take their records/videos and check on the screen through video what was wrong in each failed case.
I found some solutions that won't work today, for example:
- Screen Recorder - there is no available Microsoft Expression Encoder 4 today.
- Some solutions have problems with Headless mode.
I want to start recording after create chrome driver (in each test case), than through test's steps and stop recording on the end of each test case. I am going to check result of test case (Failed, Blocked, PASS). Than I am going to save video (in any location) if test failed/blocked and delete the video if test case PASSED.
Do you have any ideas to record driver's work ?