Made logging in a separate function. Made scraping a separte function.