def building(self): css_selector = '[data-viewmodelname="propertyBuildingInformation"]' add_name = [] add_value = [] # For judging whether there is 'Walk Score' in Building segment. if self._pq_doc('[data-bind="attr: { href: WalkScoreHelpLink }"]'): name = self._pq_doc('[data-bind=' '"attr: { href: WalkScoreHelpLink }"]').text() add_name.append(name) value = self._pq_doc('[data-bind=' '"text: FormattedWalkScore"]').text() add_value.append(value) # For judging whether there is 'Transit Score' in Building segment. if self._pq_doc('[data-bind="attr: { href: TransitScoreHelpLink }"]'): name = self._pq_doc('[data-bind="attr: ' '{ href: TransitScoreHelpLink }"]').text() add_name.append(name) value = self._pq_doc('[data-bind=' '"text: FormattedTransitScore"]').text() add_value.append(value) _building = tool_funcs.pairs_gene(self._pq_doc, css_selector, 'Building', add_name, add_value) return _building
def for_lease(self): css_selector = '[data-viewmodelname="propertyForLease"]' # inp is the choice of the repeated key-value pair. _for_lease = tool_funcs.pairs_gene(self._pq_doc, css_selector, 'For Lease', inp=1) return _for_lease
def property_contacts(self): css_selector = '.property-contacts' _property_contacts = tool_funcs.pairs_gene(self._pq_doc, css_selector, 'Property Contacts') return _property_contacts
def location(self): css_selector = '.property-location' _location = tool_funcs.pairs_gene(self._pq_doc, css_selector, ' Location') return _location
def land(self): css_selector = '[data-viewmodelname="propertyLand"]' _land = tool_funcs.pairs_gene(self._pq_doc, css_selector, 'Land') return _land
def sale(self): css_selector = "[data-viewmodelname='propertySale']" # _sale is a dict generator _sale = tool_funcs.pairs_gene(self._pq_doc, css_selector, 'Sale') return _sale