On 13/12/2018 16:56, Sammy Lee wrote: > I need help on how to open a webpage and save the HTML to a given file path, > given a URL.
You can use the standard library urllib module to fetch the file but most folks find the requests module easier to use. requests is a 3rd party module you will need to install. You can read about how to use urllib in the Web Clients topic of my tutorial(see below). Saving the HTML is just the same as saving any other string to a file. Do you know how to do that? If not the file handling topic of my tutor covers it. Your subject mentions CSV but your text only says HTML. If you do have a CSV file then the Python csv module will deal with parsing the CSV data for you. The module documentation is quite helpful. If you need to pare HTML to extract the data then the standard http module can help there. See the Web Clients topic in my tutorial for more on that too. -- Alan G Author of the Learn to Program web site http://www.alan-g.me.uk/ http://www.amazon.com/author/alan_gauld Follow my photo-blog on Flickr at: http://www.flickr.com/photos/alangauldphotos _______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor