I am trying to get the program to do a basic scraping function. I run the code below, and get no errors. I also do not get the expected action of the search field being selected and then the search terms being typed. Please help. Thank you in advance.
import time
from selenium import webdriver
from selenium.webdriver.chrome.service import Service
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.chrome.webdriver import WebDriver
Set headless mode
options = Options()
Add headless argument to ChromeOptions object
options.add_argument('--headless')
Set the path to your ChromeDriver executable
service = Service("C:\Users\mabri\OneDrive\Desktop\Programming\chrome-win\chrome.exe")
Create a Chrome driver with the options
driver = WebDriver(service=service, options=options)
Load a website
driver.get('https://www.google.com')
Wait for the page to load
time.sleep(10)
Locate the search bar and input the search query
CSS_SELECTOR = '#input'
search_bar = driver.find_element_by_css_selector(CSS_SELECTOR)
search_bar.send_keys('Python programming language')