def parse_house(link):
    driver2 = webdriver.Chrome(executable_path=driver_path)
    driver2.maximize_window()
    driver2.get(link)
    house_info = []
    page_source = driver2.page_source
    response2 = Selector(text=page_source)
    title = response2.css('.kt-page-title h1::text').get()
    address = response2.css('.kt-page-title__subtitle.kt-page-title__subtitle--responsive-sized::text').get()
    area = response2.css('.kt-group-row-item__value::text').get()
    year = response2.css('.kt-group-row-item__value::text')[1].get()
    rooms = response2.css('.kt-group-row-item__value::text')[2].get()
    price = response2.css('.kt-unexpandable-row__value::text').get()
    price_per_meter = response2.css('.kt-unexpandable-row__value::text')[1].get()
    elevator = response2.css('span.kt-group-row-item__value.kt-body.kt-body--stable::text')[0].get()
    parking = response2.css('span.kt-group-row-item__value.kt-body.kt-body--stable::text')[1].get()
    warehouse = response2.css('span.kt-group-row-item__value.kt-body.kt-body--stable::text')[2].get()
    date = response2.css('.time::text').get()
    house_info.append(title)
    house_info.append(address)
    house_info.append(area)
    house_info.append(year)
    house_info.append(rooms)
    house_info.append(price)
    house_info.append(price_per_meter)
    house_info.append(elevator)
    house_info.append(parking)
    house_info.append(warehouse)
    house_info.append(date)
    append_list_as_row('Tehran House Data.csv', house_info)
    driver2.quit()
def parse_house(link):
    driver2 = webdriver.Chrome(executable_path=driver_path)
    driver2.maximize_window()
    driver2.get(link)
    house_info = []
    page_source = driver2.page_source
    response2 = Selector(text=page_source)
    title = response2.css('.kt-page-title h1::text').get()
    address = response2.css('.kt-page-title__subtitle.kt-page-title__subtitle--responsive-sized::text').get()
    area = response2.css('.kt-group-row-item__value::text').get()
    year = response2.css('.kt-group-row-item__value::text')[1].get()
    rooms = response2.css('.kt-group-row-item__value::text')[2].get()
    price = response2.css('.kt-unexpandable-row__value::text').get()
    price_per_meter = response2.css('.kt-unexpandable-row__value::text')[1].get()
    elevator = response2.css('span.kt-group-row-item__value.kt-body.kt-body--stable::text')[0].get()
    parking = response2.css('span.kt-group-row-item__value.kt-body.kt-body--stable::text')[1].get()
    warehouse = response2.css('span.kt-group-row-item__value.kt-body.kt-body--stable::text')[2].get()
    date = response2.css('.time::text').get()
    house_info.append(title)
    house_info.append(address)
    house_info.append(area)
    house_info.append(year)
    house_info.append(rooms)
    house_info.append(price)
    house_info.append(price_per_meter)
    house_info.append(elevator)
    house_info.append(parking)
    house_info.append(warehouse)
    house_info.append(date)
    append_list_as_row('Tehran House Data.csv', house_info)
    driver2.quit()