Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import urllib
- from bs4 import BeautifulSoup as bs4
- target = "https://en.wikipedia.org/wiki/List_of_El_Clasico_matches"
- def wiki(url):
- data = bs4(urllib.urlopen(url).read(), "lxml")
- sv = []
- for i in data.table.find_all('td')[3:8]:
- if "Barcelona" in i:
- sv.append(["B", 0])
- if "Real" in i:
- sv.append(["R", 0])
- if i.b and '–' in i.b.contents[0]:
- print i.b.contents[0], i.b
- #print ",".join(i.b.contents), i.b
- print 'short dash:', "-", ord("-")
- print ' long dash:', u"–", ord(u"–")
- wiki(target)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement