Here a example with Selenium,it's not the most easy page to start with if new to this.
If you can find in info in the json return as @buran show,
then that is fine and fast way as it only requires Requests with a
If you can find in info in the json return as @buran show,
then that is fine and fast way as it only requires Requests with a
get
call and catch response .json()
.from selenium import webdriver from selenium.webdriver.chrome.options import Options from selenium.webdriver.common.keys import Keys from bs4 import BeautifulSoup import time #--| Setup options = Options() #options.add_argument("--headless") #options.add_argument("--window-size=1980,1020") browser = webdriver.Chrome(executable_path=r'C:\cmder\bin\chromedriver.exe', options=options) #--| Parse or automation url = "https://www.sreality.cz/hledani/pronajem/byty/praha?velikost=1%2B1" browser.get(url) time.sleep(3) # Use BeautifulSoup soup = BeautifulSoup(browser.page_source, 'lxml') title = soup.find('h1', class_="page-title list-title ng-binding") print(title.text) print('-' * 40) # Use Selenium info = browser.find_elements_by_xpath("//div[@class='dir-property-list']//div[1]//div[1]//div[1]") print(info[0].text)
Output:Byty 1+1 k pronájmu Praha
----------------------------------------
Pronájem bytu 1+kk 35 m²
Praha 5 - Smíchov
14 000 Kč za měsíc