Hier ist mein Code: < /p>
Code: Select all
from selenium import webdriver
from selenium.webdriver.common.by import By
url= "https://www.zoopla.co.uk/house-prices/england/?new_homes=include&q=england+&orig_q=united+kingdom&view_type=list&pn=1"
driver=webdriver.Chrome()
driver.get(url)
# Find elements using By.CLASS_NAME
houses = driver.find_elements(By.CLASS_NAME, "w6xkpv1 w6xkpv4")
for house in houses:
# Find address within each house element
address = house.find_element(By.XPATH, './/*[@id="main-content"]/div[2]/div/div/section/div[1]/div[2]/div[1]/div/div/div/div[1]/a/h2').text
print(address)