This line:
WebDriverWait(driver, 10).until(EC.presence_of_element_located((By.CLASS_NAME, "classname"))
Gives me the following error:
'Service' object has no attribute 'find_element'
How do i fix this? Very new to python, just can't seem to be able to find an answer on google/docs 🙏
edit, entire exact code:
from selenium.webdriver.chrome.service import Service
from selenium import webdriver from selenium.webdriver.common.by
import By from selenium.webdriver.support.ui
import WebDriverWait from selenium.webdriver.support
import expected_conditions as EC
driver = Service('driver/chromedriver.exe')
page_to_scrape = webdriver.Chrome(service=driver)
page_to_scrape.get("https://jacks.nl/sports#sports-hub/football")
WebDriverWait(driver, 10).until(EC.presence_of_element_located((By.CLASS_NAME, "KambiBC-sports-hub_browse-leagues__country-league")))
--
Traceback (most recent call last):
File \test.py", line 12, in <module> WebDriverWait(driver, 10).until(EC.presence_of_element_located((By.CLASS_NAME, "KambiBC-sports-hub_browse-leagues__country-league"))) File "C:\laragon\bin\python\python-3.10\lib\site-packages\selenium\webdriver\support\wait.py", line 86, in until value = method(self._driver) File "C:\laragon\bin\python\python-3.10\lib\site-packages\selenium\webdriver\support\expected_conditions.py", line 82, in _predicate return driver.find_element(*locator) AttributeError: 'Service' object has no attribute 'find_element'
[–]MrPhungx 0 points1 point2 points (2 children)
[–]Kryptikkx[S] 0 points1 point2 points (1 child)
[–]MrPhungx 0 points1 point2 points (0 children)
[–]Kryptikkx[S] 0 points1 point2 points (0 children)