I do not understand why Selenium does not allow me to search for elements within elements. I want to create a new element called property that contains the subset of data I would like to obtain from 'main' which I extracted from the website. I heard Selenium decented find_element so I am unsure what else to use here.
website for reference: https://www.hellolanding.com/s/austin-tx/apartments/furnished
from ast import Try
from gettext import find
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
import time
driver = webdriver.Chrome(executable_path="C:/Users/Carson/Desktop/chromedriver.exe")
driver.get("https://www.hellolanding.com/s/austin-tx/apartments/furnished")
try:
main = WebDriverWait(driver, 5).until(
EC.presence_of_element_located((By.ID,'search-home-list-wrapper'))
)
property = main.find_elements(By.CLASS_NAME, 'transition-delay[200ms] relative flex flex-col mb-6 w-full overflow-hidden e1mngczp3 rounded-t-lg css-12puc69 e4dpi0y0')
print(property.text)
print("successsssssssssssssssssssssssssssss")
driver.quit()
except:
driver.quit()
print("failed")
subset of datayou are looking for?