Advertisement
Joeytje50

Untitled

Nov 29th, 2012
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. from lxml import parse
  2.  
  3. doc = parse('http://services.runescape.com/m=itemdb_rs/top100.ws').getroot()
  4.  
  5. obj = {}
  6. cells = doc.cssselect('tbody tr[data-item-id] td:last-child')
  7. for td in cells:
  8.     obj[td.get('data-item-id')] = td.text_content()
  9.  
  10. print obj
  11.  
  12. #obj now contains all data in the format {"2":"107.6m",...}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement