Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import mechanize
- import urllib2
- import re
- word_regex = re.compile("\/word\/([a-z]{4})\/")
- response = urllib2.urlopen('http://www.scrabblefinder.com/4-letter-words/')
- headers = response.info()
- source = response.read()
- #word_list = re.findall(word_regex, source)
- word_list = ["poptarts", "booooaweifj"]
- untaken_words = []
- for word in word_list:
- response2 = urllib2.urlopen('http://www.neopets.com/petlookup.phtml?pet=%s', word)
- source2 = response2.read()
- if source2.find("Sorry, there is no Neopet by that name in Neopia.") != -1:
- untaken_words.append(word)
- print untaken_words
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement