Exemplo n.º 1
0
def six_degrees_kevin_bacon():
    bsObj = get_bs_obj("https://en.wikipedia.org/wiki/Kevin_Bacon")
    if bsObj == None:
        return

    for link in bsObj.find("div", {"id":"bodyContent"}).findAll("a", href=re.compile("^(/wiki/)((?!:).)*$")):
        if 'href' in link.attrs:
            print(link.attrs['href'])
Exemplo n.º 2
0
def gathering():
    bsObj = get_bs_obj("http://gatherer.wizards.com/Pages/Search/Default.aspx?action=advanced&format=+[\"Standard\"]")
    if bsObj == None:
        return
    
    try:
        namesList = bsObj.findAll("span", {"class":"cardTitle"})
    except AttributeError as e:
        print("Tag(s) not found")

    if namesList == None:
        return

    for name in namesList:
        print(name.get_text())