Skip to content

Instantly share code, notes, and snippets.

@wildaces215
Last active June 14, 2023 23:18
Show Gist options
  • Select an option

  • Save wildaces215/edaa900c5449bf30671efb9a2187d372 to your computer and use it in GitHub Desktop.

Select an option

Save wildaces215/edaa900c5449bf30671efb9a2187d372 to your computer and use it in GitHub Desktop.
Quick selenium script
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.by import By
from selenium.webdriver.chrome.options import Options
import time
options = Options()
options.headless = True
driver = webdriver.Firefox()
driver.get("https://www.google.com")
time.sleep(2)
driver.find_element(By.ID,"APjFqb").send_keys("AAPL")
time.sleep(2)
driver.find_element(By.CSS_SELECTOR,".FPdoLc > center:nth-child(1) > input:nth-child(1)").send_keys(Keys.ENTER)
driver.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment