Esempio n. 1
0
    def details(self, dataframe=True):
        string = self.soup.find(name='div', attrs={'id': 'historic-listing-content'}).text
        features = text_inbetween(string.replace('\n', '. '), 'Property features', 'Property description')
        description = text_inbetween(string.replace('\n', '. '), 'Property description', 'Previously marketed by')
        data = {'listing_id': self.listing_id, 'description': description, 'features': features,
                'date_generated': datetime.now()}

        return pd.DataFrame.from_dict(data, orient='index').T if dataframe else data
Esempio n. 2
0
 def location(self):
     string = text_inbetween(text=self.html.text.replace('\n', '').replace(
         ' ', ''),
                             left='"coordinates":',
                             right=',"pin"')
     string = string.replace('false', 'False').replace('true', 'True')
     return ast.literal_eval(string)
Esempio n. 3
0
 def location(self):
     string = text_inbetween(
         text=self.html.text.replace('\n', '').replace(' ', ''),
         left='"coordinates":',
         right=',"pin":"https://r.zoocdn.com/assets/map-pin.png')
     string = string.replace('false', 'False').replace('true', 'True')
     return ast.literal_eval(string)
Esempio n. 4
0
 def details(self):
     string = text_inbetween(text=self.html.text.replace('\n', '').replace(
         ' ', ''),
                             left='ZPG.trackData.taxonomy=',
                             right=';</script><script>d')
     string = string.replace('{', '{"').replace(':', '":').replace(
         ',', ',"').replace('null', '"null"')
     return ast.literal_eval(string)