function to fetch webpage, store in file