本文整理匯總了Python中listing.Listing.town方法的典型用法代碼示例。如果您正苦於以下問題:Python Listing.town方法的具體用法?Python Listing.town怎麽用?Python Listing.town使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類listing.Listing
的用法示例。
在下文中一共展示了Listing.town方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: collect_page_results
# 需要導入模塊: from listing import Listing [as 別名]
# 或者: from listing.Listing import town [as 別名]
def collect_page_results(self, store):
names = self.driver.find_elements_by_xpath('//a[@name="listpage_productname"]')
model_numbers = self.driver.find_elements_by_xpath('//ul[@class="productInfo"]/li[@class="last"]')
item_numbers = self.driver.find_elements_by_xpath('//ul[@class="productInfo"]/li[not(@class="last")]')
prices = self.driver.find_elements_by_xpath('//p[@class="pricing"]/strong')
self.load_next_check = model_numbers[0].text[9:]
page_results = []
for i in range(0, len(names)):
listing = Listing()
listing.name = names[i].text
listing.item_number = item_numbers[i].text[8:]
listing.model_number = model_numbers[i].text[9:]
listing.price = prices[i].text[1:]
listing.country = store.country
listing.state = store.state
listing.town = store.town
listing.store_number = store.store_number
listing.address = store.address
page_results.append(listing)
return page_results