$ python dictionary.py Look up: albatross albatross: 1. Any of several large web-footed birds constituting the family Diomedeidae, chiefly of the oceans of the Southern Hemisphere, and having a hooked beak and long narrow wings. 2. A constant, worrisome burden. 3. An obstacle to success.
$ python dictionary.py Look up: apoplexy apoplexy: 1. Sudden impairment of neurological function, especially that resulting from a cerebral hemorrhage; a stroke. 2. A sudden effusion of blood into an organ or tissue. 3. A fit of extreme anger; rage: The proud... members suffered collective apoplexy, and this year they are out for blood (David Finch).
$ python dictionary.py Look up: invective invective: 1. Denunciatory or abusive language; vituperation. 2. Denunciatory or abusive expression or discourse.
Don't worry about all these ridiculous forms. Just go for the first <OL> block and deal with everything inside that. Some of these will include sub-<OL> blocks too. In particular, you're likely to see tags like, <OL TYPE='a'>." Such a block will also contain <LI> tags, and you should handle these like the other <LI> tags.
Don't worry about words that aren't found in the dictionary (unless you want to). In other words, there's no need to provide a "no matches" message if the user asks for the definition of say, "iblibibibftthp," or "nucular."
1. Any of several large web-footed birds constituting the family Diomedeidae, chiefly of the oceans of the Southern Hemisphere, and having a hooked beak and long narrow wings. 2. a. A constant, worrisome burden. b. An obstacle to success.You may number these as simply, "1.," "2.," and "3."
There's a slight catch, though. If you're not careful, you might end up with an extra space after "2." and "3." You should be able to avoid this with a regular expression.
Although you don't need to translate special HTML characters, you should remove them. Without doing so, your third definition for apoplexy might look like this:
3. A fit of extreme anger; rage: “The proud... members suffered collective apoplexy, and this year they are out for blood” (David Finch).