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