當前位置: 首頁>>代碼示例>>Python>>正文


Python Listing.living_area方法代碼示例

本文整理匯總了Python中listing.Listing.living_area方法的典型用法代碼示例。如果您正苦於以下問題:Python Listing.living_area方法的具體用法?Python Listing.living_area怎麽用?Python Listing.living_area使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在listing.Listing的用法示例。


在下文中一共展示了Listing.living_area方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: parse_node

# 需要導入模塊: from listing import Listing [as 別名]
# 或者: from listing.Listing import living_area [as 別名]
def parse_node(node):
    children = itol(node.children)

    listing = Listing()

    try:

        # first row
        chillen = itol(children[0])
        listing.mls = chillen[0].find_all(text=re.compile('\d{8}'))[0].strip()
        listing.status = parse_string(chillen[1], 'Status: ')
        ginz = chillen[2].find_all(text=re.compile('\d*'))
        listing.dom = int(ginz[1].strip())
        listing.dto = int(ginz[3].strip())
        listing.sale_price = parse_money(chillen[3], 'Sale Price: ')
        listing.list_price = parse_money(chillen[4], 'List Price: ')

        # second row
        in_ = itol(children[1])
        address1 = in_[0].getText()
        listing.price_sqft_list = Money(str(parse_sqft(in_[1])), 'USD')
        listing.sale_date = parse_date(in_[2])
        listing.list_date = parse_date(in_[3])

        # third row
        da = itol(children[3])
        address2 = da[0].getText()
        listing.address = address1 + ' ' + address2
        listing.price_sqft_sold = Money(str(parse_sqft(da[1])), 'USD')
        listing.off_mkt_date = parse_date(da[2])
        listing.orig_price = parse_money(da[3], 'Orig. Price:  ')

        # fourth row
        club = itol(children[4])
        listing.style = parse_string(club[0], 'Style: ')
        listing.outdoor_space = parse_string(club[1], 'Outdoor Space: ')
        listing.assoc_fee = parse_money(club[2], 'Assoc.Fee: ')

        # fifth row
        bottle = itol(children[6])
        listing.rooms = parse_int(bottle[0], 'Rooms: ')
        listing.beds = parse_int(bottle[1], 'Beds: ')
        listing.baths = parse_string(bottle[2], 'Baths: ')
        listing.living_area = parse_int(bottle[3], 'Living Area: ')
        listing.tax = parse_money(bottle[4], 'Tax: ')

        # sixth row
        full = itol(children[8])
        listing.garage = parse_int(full[0], 'Garage: ')
        listing.parking = parse_int(full[1], 'Parking: ')
        listing.pets = parse_string(full[2], 'Pets: ')
        listing.year_built = parse_int(full[3], 'Year Built: ')
        listing.fy = parse_int(full[4], 'Fy: ')

        # seventh row
        of_bub = itol(children[10])
        listing.remarks = parse_string(of_bub[0], 'Remarks: ')
    except:
        # I'm a monster
        listing.remarks = u''
        pass

    return listing
開發者ID:njason,項目名稱:diginic,代碼行數:65,代碼來源:parse.py


注:本文中的listing.Listing.living_area方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。