1# example.py
2
3from selenium import webdriver
4
5# Start Chrome Driver
6chromedriver = 'Users/me/Documents/MyPrograme/chromedriver'
7
8driver = webdriver.Chrome(chromedriver)
9
10# Open the URL you want to execute JS
11URL = 'https://www.example.com'
12driver.get(URL)
13
14# Execute JS
15
16driver.execute_script("console.log(`Hello from Python`)")
17