Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set up Selenium (get the Chrome driver) #2

Open
slevin48 opened this issue Jun 24, 2023 · 0 comments
Open

Set up Selenium (get the Chrome driver) #2

slevin48 opened this issue Jun 24, 2023 · 0 comments

Comments

@slevin48
Copy link
Owner

from urllib.request import urlopen
import json
res = urlopen('https://googlechromelabs.github.io/chrome-for-testing/last-known-good-versions-with-downloads.json')
data = json.load(res)
# data
# data['channels'].keys()
data['channels']['Stable']['version']
for p in data['channels']['Stable']['downloads']['chrome']:
    print(p['platform'], p['url'])
url_win64 = data['channels']['Stable']['downloads']['chrome'][4]['url']
url_win64
# Get the file name from the url path
import os
os.path.basename(url_win64)
# Download the file
import urllib.request
urllib.request.urlretrieve(url_win64, os.path.basename(url_win64))
# unzip the file
import zipfile
with zipfile.ZipFile(os.path.basename(url_win64), 'r') as zip_ref:
    zip_ref.extractall('chrome-win64')
# Copy the chrome.exe to the current directory
import shutil
shutil.copyfile('chrome-win64/chrome-win64/chrome.exe', 'chrome.exe')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant