|
|
@@ -209,6 +209,8 @@ def parse_search_grid(selector, auction_id, auction_name):
|
|
|
lot_href = tds[1].css('a::attr(href)').get() or ""
|
|
|
inventory_id = parse_inventory_id(lot_href)
|
|
|
detail_url = urljoin(BASE_URL, lot_href) if lot_href else ""
|
|
|
+ min_bid = tds[3].xpath('./text()').get() or ""
|
|
|
+ final_price = tds[4].xpath('normalize-space(.)').get() or ""
|
|
|
|
|
|
rows.append({
|
|
|
"auction_id": auction_id, # 场次 id
|
|
|
@@ -216,11 +218,12 @@ def parse_search_grid(selector, auction_id, auction_name):
|
|
|
"lot_number": tds[1].xpath('normalize-space(.)').get() or "", # 第 2 列 Lot Number
|
|
|
"inventory_id": inventory_id, # 从 LotDetail 链接抽出
|
|
|
"title": tds[2].xpath('normalize-space(.)').get() or "", # 第 3 列 Title
|
|
|
- "min_bid": tds[3].xpath('normalize-space(.)').get() or "", # 第 4 列 Min Bid
|
|
|
- "final_price": tds[4].xpath('normalize-space(.)').get() or "", # 第 5 列 Final Price
|
|
|
+ "min_bid": min_bid.replace('$', '').replace(',', '') if min_bid else "", # 第 4 列 Min Bid
|
|
|
+ "final_price": final_price.replace('$', '').replace(',', '') if final_price else "", # 第 5 列 Final Price
|
|
|
"status": tds[5].xpath('normalize-space(.)').get() or "", # 第 6 列 Status
|
|
|
"detail_url": detail_url, # 详情绝对 URL
|
|
|
})
|
|
|
+ # print(rows)
|
|
|
return rows
|
|
|
|
|
|
|
|
|
@@ -397,5 +400,5 @@ def update_details_for_pending(log, sql_pool):
|
|
|
)
|
|
|
|
|
|
|
|
|
-if __name__ == '__main__':
|
|
|
- get_details(logger,'https://wheatlandauctionservices.com/LotDetail.aspx?inventoryid=15233', None, 1)
|
|
|
+# if __name__ == '__main__':
|
|
|
+# get_details(logger,'https://wheatlandauctionservices.com/LotDetail.aspx?inventoryid=15233', None, 1)
|