Skip to content

Commit

Permalink
fix it
Browse files Browse the repository at this point in the history
  • Loading branch information
omorilewa committed Jun 29, 2017
1 parent 3146c7e commit 786137e
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions healthtools/scrapers/base_scraper.py
Expand Up @@ -67,14 +67,15 @@ 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
divisor = self.num_pages_to_scrape / 10

for page_num in range(1, self.num_pages_to_scrape + 1):

if page_num == divisor:
print "[{}] - Scraped {}% out of {} pages.".format(datetime.now().strftime("%Y-%m-%d %H:%M:%S"), (float(page_num) / self.num_pages_to_scrape) * 100, self.num_pages_to_scrape)
print "[{}] - Scraped {} out of {} pages.".format(datetime.now().strftime("%Y-%m-%d %H:%M:%S"), page_num, self.num_pages_to_scrape)
divisor = divisor + page_num
elif page_num == self.num_pages_to_scrape:
print "[{}] - Scraped {}% out of this {} pages.".format(datetime.now().strftime("%Y-%m-%d %H:%M:%S"), page_num, self.num_pages_to_scrape)
print "[{}] - Scraped {} out of this {} pages.".format(datetime.now().strftime("%Y-%m-%d %H:%M:%S"), page_num, self.num_pages_to_scrape)
else:
test = 0

Expand Down

0 comments on commit 786137e

Please sign in to comment.