Skip to content

Set up Selenium (get the Chrome driver) #2

Description

@slevin48
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')

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions