im keep getting Unresolved reference 'By'
here is the code:
from selenium import webdriver
driver = webdriver.Chrome()
driver.get("https://www.indiegogo.com/explore/home?project_type=campaign&project_timing=all&sort=trending")
driver.implicitly_wait(0.5)
vegetable = driver.find_element(By.CSS_SELECTOR, "tomatoes")
CodePudding user response:
add the reference
from selenium.webdriver.common.by import By
CodePudding user response:
first you need to import By
from selenium.webdriver.common.by import By
whole code
from selenium import webdriver
from selenium.webdriver.common.by import By
driver = webdriver.Chrome()
driver.get("https://www.indiegogo.com/explore/home?project_type=campaign&project_timing=all&sort=trending")
driver.implicitly_wait(0.5)
vegetable = driver.find_element(By.CSS_SELECTOR, "tomatoes")