Created
February 19, 2014 16:25
-
-
Save MichaelDiBernardo/9095575 to your computer and use it in GitHub Desktop.
Find random Price is Right game
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import random | |
import requests | |
from bs4 import BeautifulSoup | |
if __name__ == "__main__": | |
r = requests.get("http://en.wikipedia.org/wiki/List_of_The_Price_Is_Right_pricing_games") | |
soup = BeautifulSoup(r.content) | |
games = soup.find_all("span", {"class":"mw-headline"}) | |
while True: | |
choice = random.choice(games).text | |
if len(choice) <= 1: | |
continue | |
print choice | |
break |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
NICE 👍