15-110: Principles of Computing - Week 10
Input and output from files
- Load a text file into a single string
- Load a text file into a list of strings
- Save a string to a text file
Example: fileIO.py
Web scraping and HTML generation
- Download a web page into a string
-
Identify the location of relevant information in a web page:
- Find the appropriate line, using a text identifier that is present only in that line
- Find a left delimiter and a right delimiter for the information you want to get from that line
- Slice a substring between the two delimiters
- Use the information you scraped to generate your own HTML pages
Example: webScraping.py