📜  如何在 python 代码示例中的谷歌浏览器控制台中编写

📅  最后修改于: 2022-03-11 14:47:21.650000             🧑  作者: Mango

代码示例1
# example.py

from selenium import webdriver

# Start Chrome Driver
chromedriver = 'Users/me/Documents/MyPrograme/chromedriver'

driver = webdriver.Chrome(chromedriver)

# Open the URL you want to execute JS
URL = 'https://www.example.com'
driver.get(URL)

# Execute JS

driver.execute_script("console.log(`Hello from Python`)")