I am trying to scrape this website enter link description here. we have almost ten different opportunities on each page. each one has its own title and details. I want to get all this information. I have written a python code that can locate other required tags and information but I can't locate the paragraphs that contain a description in it.
here is my code.
base_url = "https://www.enabel.be/content/enabel-tenders"
driver.get(base_url)
WebDriverWait(driver , 10).until(EC.visibility_of_element_located(
(By.XPATH , "//*[@id='block-views-tenders-block']/div/div/div[@class='view-content']/div")))
current_page_tag = driver.find_element(By.XPATH ,
"//*[@id='block-views-tenders-block']/div/div/div[3]/ul/li[2]").text.strip()
all_divs = driver.find_elements(By.XPATH ,
"//*[@id='block-views-tenders-block']/div/div/div[@class ='view-content' "
"]/div")
for each_div in all_divs :
singleData = {
# could not detect
"language" : 107 ,
# means open
"status" : 0 ,
"op_link" : "" ,
"website" : website_name ,
"close_date" : '' ,
# means not available
"organization" : website_name ,
"description" : "" ,
"title" : '' ,
"checksum" : "" ,
# means not available
"country" : '' ,
"published_date" : ''
}
singleData['title'] = each_div.find_element(By.XPATH ,
".//span[@class='title-accr no-transform']").text.strip()
singleData['country'] = each_div.find_element(By.XPATH ,
".//div[1]/div/div/div[@class ='field-items']/div").text.strip()
close_date = each_div.find_element(By.XPATH , ".//div//div[1]/div").text.strip()
#description always returns me empty text.
description = each_div.find_element(By.XPATH, ".//div/div[2]/div[3]/div[2]/div/p").text.strip()
download = each_div.find_elements_by_xpath('.//div//div[2]/div[4]/div[2]//a')
download_file_link = []
for eachfile in download :
download_file_link.append(eachfile.get_attribute('href'))
my code can get the title, country, deadline, and its attachment but can't get the description part. it returns me an empty text but when I see it on the website it has text in it.
can anyone help me with the issue and solution. thanks in advance