You need to read the contents of a web page into a string using Python.
Python has an extensive library for making HTTP requests.
The following example reads the contents of the Google home page into the string contents:
import urllib2 contents = urllib2.urlopen(“https://www.google.com/”).read() print(contents) |
Discussion
Having read the HTML, you are then likely to want to search it and extract the parts of the text that you really want. For this, you will need to use the string manipulation functions (see Recipes 5.14 and 5.15).
See Also
For an example of using web requests to check for Gmail messages, see Recipe 7.15.