from selenium import webdriver from selenium.webdriver.common.by import By import time url = "https://www.classcentral.com/collection/top-free-online-courses" driver = webdriver.Chrome() driver.get(url) time.sleep(1) all_courses = driver.find_element(by=By.CLASS_NAME, value='catalog-grid__results') course_titles = all_courses .find_elements(by=By.CSS_SELECTOR, value='[class="color-charcoal course-name"]') for title in course_titles: print(title.text)
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)