Return to Snippet

Revision: 33235
at October 7, 2010 04:14 by fatribz


Initial Code
import urllib
from lxml.html import fromstring

def getRhymes(word):
    url = 'http://www.rhymer.com/RhymingDictionary/%s.html' % word
    doc = fromstring(urllib.urlopen(url).read())
    for i in doc.find_class('blue'):
        items = i.xpath('tr/td/a')
        return [hmm.text for hmm in items]

Initial URL

                                

Initial Description
needs external library lxml

Initial Title
Find rhyming words

Initial Tags
python

Initial Language
Python