Move your connect statement *after* the get request. Also, where do you open file for writing?
Edit: If you are going to write the file in the way you're attempting, you need to make sure you open the file to append data to the end of the file, or else each write will overlay prior data you've written.
Bookmarks