Scraping all pages successfully and writing to file