I'm attempting to find all occurrences of a particular class on the webpage https://uk.indeed.com/jobs?q=python&l=York but selenium is just returning an empty list. The eventual aim is to extract the job title names of each position, but i can't seem to retrieve the initial data.
from selenium import webdriver
url = 'https://uk.indeed.com/jobs?q=python&l=York'
driver = webdriver.Firefox()
driver.get(url)
jobs = driver.find_elements_by_class_name("jobsearch-SerpJobCard unifiedRow row result clickcard")
print(jobs)
I have also tried using WebDriverWait but i get no return again, not even an empty list but instead just nothing? Is it maybe something to do with the way i'm using the class name? As when i use the XPATH i can get some data back.
Here is the WebDriverWait code attempt.
from pprint import pprint
from selenium import webdriver
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.by import By
url = 'https://uk.indeed.com/jobs?q=python&l=York'
driver = webdriver.Firefox()
driver.get(url)
jobs = WebDriverWait(driver, 10).until(EC.presence_of_all_elements_located((By.CLASS_NAME, 'jobsearch-SerpJobCard unifiedRow row result clickcard')))