FIX Save person name as contact:name to ad yaml instead of city name

This commit is contained in:
Jeppy
2022-11-05 19:37:08 +01:00
committed by Sebastian Thomschke
parent 9d5c6efe9c
commit faa71ac03f

View File

@@ -130,7 +130,12 @@ class AdExtractor:
address_halves = address_text.split(' - ') address_halves = address_text.split(' - ')
address_left_parts = address_halves[0].split(' ') # zip code and region/city address_left_parts = address_halves[0].split(' ') # zip code and region/city
contact['zipcode'] = address_left_parts[0] contact['zipcode'] = address_left_parts[0]
contact['name'] = address_halves[1]
contact_person_element = self.driver.find_element(By.CSS_SELECTOR, '#viewad-contact')
name_element = contact_person_element.find_element(By.CLASS_NAME, 'iconlist-text')
name = name_element.find_element(By.TAG_NAME, 'a').text
contact['name'] = name
if 'street' not in contact: if 'street' not in contact:
contact['street'] = None contact['street'] = None
try: # phone number is unusual for non-professional sellers today try: # phone number is unusual for non-professional sellers today