I had a notebook for scraping Indiegogo website that was working perfectly, not I got errors as I see css selector method is now deprecated. I checked the website and nothing has changed, and I try to update my methods but still it does not work:
import sys
import logging
from selenium.webdriver.remote.remote_connection import LOGGER
LOGGER.setLevel(logging.WARNING)
sys.path.insert(0,'/usr/lib/chromium-browser/chromedriver')
from selenium import webdriver
from tqdm import tqdm_notebook as tqdm
import pandas
import json
import pprint
chrome_options = webdriver.ChromeOptions()
chrome_options.add_argument('--headless')
chrome_options.add_argument('--no-sandbox')
chrome_options.add_argument('--disable-dev-shm-usage')
chrome_options.add_argument("user-agent=Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.212 Safari/537.36")
wd = webdriver.Chrome('chromedriver',chrome_options=chrome_options)
wd.get("https://www.indiegogo.com/explore/all?project_type=campaign&project_timing=all&sort=trending")
list_titles = wd.find_element(By.CSS_SELECTOR, "div.discoverableCard-title")
print(len(list_titles))
this is what is suggested, by running this in Colab says:
name 'By' is not defined