Advertisement
Guest User

Untitled

a guest
Jun 25th, 2019
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. from bs4 import BeautifulSoup as bs
  2.  
  3. filedata = open('bymarket.xml')
  4.  
  5. cont = bs(filedata, 'lxml')
  6.  
  7. course = cont.find('venue')
  8. print(course.text)
  9. container = cont.find('runners')
  10. item = container.find_all('runnernode')
  11. for horse in item:
  12. runner = horse.find('runnername').text
  13. odds = horse.find('availabletolay').find('price').text
  14. print(runner, odds)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement