WalmartScraper module
- class WalmartScraper.WalmartScraper(url)
Bases:
objectThis is the Scraper for Walmart. Takes in product url as input upon object creation. Method ‘job’ prints progress while method ‘check_stock’ obtains stock info and a string indicating cost of the product.Walmart pages can have stock info in different ways. Following are the possible cases, interpretations, and return values of each case.Case
Interpretation
Scraper return value
Add to Cart
Product is in stock
In Stock
Out of Stock
Product is out of stock
Out of Stock
- check_stock_price(url)
Obtains stock information from the given url.
- Parameters
url – URL of the product
- Returns
a string indicating the stock information and a string indicating cost of the product
- job()
Prints the progress, and delegates the task to ‘check_stock’.
- Returns
a string indicating the stock information and a string indicating cost of the product