Hints
This seems complicated, but the actual algorithm can be written in Python with very little code. Here it is:
- Connect to the site and get its content.
- Navigate the DOM to the element around the poem and get its text attached to a variable label.
- Cut out any elements of the text you don't want.
- Make a counter (see below).
- Loop i through to range(len(text) - 1)
- Taking text[i] + " " + text[i+1] as the key, increment the counter by one.
- End the i loop.
- Print the most common elements from the counter.
Remember, build it up a line at a time, testing what each line gives you before moving on.
Libraries that would help include requests; bs4; collections. Functions that would help include: str.replace(); str.split(); see also the lecture on libraries to see how to use collections.Counter.