I recently started learning web scraping. I wanted to have some information about the Job ads in the "Indeed" website. My problem is that when I click on the job name, the site shows the job description on the right side. I want to have access to this part to get information out but I run into this problem every time :
Message: no such element: Unable to locate element: {"method":"css selector","selector":"[id="jobDescriptionText"]"}
I tried other ways , but I couldn't solve it , so How can I get access to that part without getting that Error?
driver.get('https://www.indeed.com/')
def job_city():
job_name = driver.find_element_by_css_selector("input[name='q']")
job_name.clear()
city = driver.find_element_by_css_selector("input[name='l']")
city.clear()
job_name.send_keys('Data scientist')
city.send_keys('New york')
driver.find_element_by_class_name('icl-WhatWhere-buttonWrapper').click()
#time.sleep(10)
job_city()
main = driver.find_element_by_id('mosaic-provider-jobcards')
n_jobs = main.find_elements_by_tag_name('a')
jobs = list()
links = list()
#I wanted to have the job links so I made this loop
for num in range(len(n_jobs)):
if (len(n_jobs[num].get_attribute('id')))==0:
pass
else:
links.append(n_jobs[num].get_attribute('href'))
jobs.append(n_jobs[num])
i = 0
for job in jobs:
title = job.find_element_by_tag_name('h2').find_elements_by_tag_name('span')
job.find_element_by_tag_name('h2').click()
time.sleep(3)
info_right_side = driver.find_element_by_id('jobDescriptionText')
.
.
.