1

I have written a python script to open few pages with chrome, but sometimes I have issue with compatibility with chrome driver and chrome browser. And I want to have updated version of both chrome browser and driver for my requirement. So is there a way I can update Chrome browser using python ?

EDIT : I want it for Windows.

Rahul
  • 1,607
  • 3
  • 23
  • 41

1 Answers1

0

You took too long to specify whether you were on windows or *nix.. so i took the linux route, who develops on windows anyways? :P Any who.. just convert this to batch file or powershell??? script...

Normally I stick this inside a install.sh that does this:

#!/bin/bash

# Install virtualenv
virtualenv venv

# Install python dependencies
venv/bin/pip install -r requirements.txt

# Install chromedriver
cd venv/bin/
curl -s https://chromedriver.storage.googleapis.com/2.9/chromedriver_linux64.zip
unzip chromedriver_linux64.zip
rm chromedriver_linux64.zip

This will setup the entire environment, your virtualenv need is taken care of and your chrome driver too.

Javier Buzzi
  • 6,296
  • 36
  • 50
  • but this will do the trick for chromedriver but wont update the browser, right ? – Rahul May 24 '18 at 14:04
  • @Rahul update the browser? No, Chrome autoupdates, there is no need to update it manually. – Javier Buzzi May 24 '18 at 14:18
  • I want to control it, so I want to check if chrome is updated or not, if its not update it first and then run my script. – Rahul May 24 '18 at 15:25
  • @Rahul, i dont think you can control that, you can get the version of chrome.. and compare it to the current version of chrome (doing a curl and some parsing), but i highly doubt you can tell chrome NOT to update. – Javier Buzzi May 24 '18 at 15:52
  • I stand corrected. https://stackoverflow.com/questions/18483087/how-to-disable-google-chrome-auto-update there is a away to disable it. – Javier Buzzi May 24 '18 at 15:53
  • My two cents. Don't bother, let it autoupdate, the chromedrivers are very stable, you can use old drivers with new versions without issues (ive been on 2.35 for a long time and theyre by 2.9 -- 0 issues, as a matter of fact i just realized how behind i was because i havent needed to update, my script still works like a champ) – Javier Buzzi May 24 '18 at 15:57
  • great !! let me try – Rahul May 24 '18 at 16:11