def getBestSellers(self):
best_Seller_Scraper = Best_Seller_Scraper()
print("Just assigned best_Seller_Scraper = Best_Seller_Scraper.Best_Seller_Scraper")
driver = webdriver.PhantomJS("/phantomjs-2.1.1-windows/bin/phantomjs.exe")
print("Just assigned driver = webdriver.PhantomJS()")
bestSellers = []
#Navigate to Amazon's best seller list
#Scrape all the Best Seller categories from Amazon and return them as an array
bestSellerCategories = best_Seller_Scraper.getAmazonBestSellerCategories(driver)
print("got best seller categories")
#Loop through each of the categories and pass them into the getSubCategories method
for bestSellerCategory in bestSellerCategories:
bestSellerSubCategories = best_Seller_Scraper.getSubCategories(bestSellerCategory, driver)
#Loop through each of the subCategories and pass them into the getBestSeller method
for bestSellerSubCategory in bestSellerSubCategories:
bestSellers = best_Seller_Scraper.getBestSellers(bestSellerSubCategory, driver)
#Return the bestSellers array after it has members added to it
return bestSellers
Amazon_Scraper.py 文件源码
python
阅读 23
收藏 0
点赞 0
评论 0
评论列表
文章目录