i have a 100 list in spreadsheet that content many keywords. i want to search in google automatically. i have try this code but does not work. what should i do ?
from selenium import webdriver
# Taking input from user
search_string = input("Input the URL or string you want to search for:")
# This is done to structure the string
# into search url.(This can be ignored)
search_string = search_string.replace(' ', '+')
# Assigning the browser variable with chromedriver of Chrome.
# Any other browser and its respective webdriver
# like geckodriver for Mozilla Firefox can be used
browser = webdriver.Chrome('chromedriver')
for i in range(1):
matched_elements = browser.get("https://www.google.com/search?q=" +
search_string + "&start=" + str(i))
when i try this code, there was error :
File "C:\Users\iyyaj\script.py", line 13, in <module>
browser = webdriver.Chrome('chromedriver')
File "C:\Users\iyyaj\anaconda3\lib\site-packages\selenium\webdriver\chrome\webdriver.py", line 45, in __init__
super().__init__(
File "C:\Users\iyyaj\anaconda3\lib\site-packages\selenium\webdriver\chromium\webdriver.py", line 51, in __init__
self.service.path = DriverFinder.get_path(self.service, options)
File "C:\Users\iyyaj\anaconda3\lib\site-packages\selenium\webdriver\common\driver_finder.py", line 40, in get_path
msg = f"Unable to obtain driver for {options.capabilities['browserName']} using Selenium Manager."
AttributeError: 'str' object has no attribute 'capabilities'
i just want to make in one code and the input are in excel or csv file