Firstly I want to point out that I’m new to python and web scraping and I was learning how to web scrape with selenium.
I precisely followed a tutorial on how to set it up and suddenly an error occured – I searched for fixes on the web but I couldn’t find one.
Can anyone help?
here is a screenshot of the code:
https://i.sstatic.net/WXkIGRwX.png
>Solution :
Change this:
from selenium.webdriver.common.service import Service
To:
from selenium.webdriver.chrome.service import Service
Suggestion: If you are using selenium v4.6.0 or higher, you don’t need to manually set the driver path. Hence you don’t need Service class.
Code can be as simple as:
from selenium import webdriver
driver = webdriver.Chrome()
driver.get("https://www.google.com/")
driver.quit()
Ref: https://stackoverflow.com/a/76463081/7598774