Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from bs4 import BeautifulSoup as bs
- filedata = open('bymarket.xml')
- cont = bs(filedata, 'lxml')
- course = cont.find('venue')
- print(course.text)
- container = cont.find('runners')
- item = container.find_all('runnernode')
- for horse in item:
- runner = horse.find('runnername').text
- odds = horse.find('availabletolay').find('price').text
- print(runner, odds)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement