Skip to content

Commit

Permalink
reformatting here
Browse files Browse the repository at this point in the history
  • Loading branch information
omorilewa committed Jun 29, 2017
1 parent 06d8392 commit 9de3b64
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions healthtools/scrapers/base_scraper.py
Expand Up @@ -68,10 +68,11 @@ def scrape_site(self):
print "[{0}] ".format(re.sub(r"(\w)([A-Z])", r"\1 \2", type(self).__name__))
print "[{0}] - Started Scraper.".format(datetime.now().strftime("%Y-%m-%d %H:%M:%S"))
self.get_total_number_of_pages()
divisor = self.num_pages_to_scrape / 5
for page_num in range(1, self.num_pages_to_scrape + 1):
print "Number of pages over 5 {}".format(self.num_pages_to_scrape / 5)
if (self.num_pages_to_scrape / 5) % page_num == 0:
if page_num == divisor :
print "[{}] - Scraped {}% out of {} pages.".format(datetime.now().strftime("%Y-%m-%d %H:%M:%S"), (page_num/self.num_pages_to_scrape) * 100, self.num_pages_to_scrape)
divisor = divisor + page_num
else:
print "[{}] - Scraped {}% out of {} pages.".format(datetime.now().strftime("%Y-%m-%d %H:%M:%S"), page_num, self.num_pages_to_scrape)

Expand Down

0 comments on commit 9de3b64

Please sign in to comment.