Hello,
I'm using selenium in the python tool to do some web scraping. For this purpose, we are using Google Chrome and the chromedriver.
Sometimes Chrome updates without my knowledge on the server machine and so the workflow fails.
On my local machine, i can either use the os library in python and os.popen to run a wmi query to get the version of Google Chrome installed and then consequently use that to get the corresponding chromedriver version or i've also tried using the run command tool and pointing to a powershell file that grabs google chrome version and both work. When I try to run these on the server the wmi query returns nothing, I think possibly because Alteryx is mounted on the D drive of the server machine.
Do you have any suggestions please?
Best Wishes
Liam
Hey Liam,
The version of Chrome matches the version published in the exe metadata:
As such, you can use python to query the metadata of the chrome exe to determine it's version. The very first example here does exactly that.
Using that you can then programatically download the appropriate version of chromedriver and use that to invoke selenium.
Although, if Chrome has auto-updated, could you not just grab the latest chromedriver.exe without bothering to check the current version ofuse that ... the versions of the latest releases typically match.
Ross