Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- html='E:/download/indonesia.html'
- fp=open(html)
- content=fp.read()
- fp.close()
- data={}
- rep=lambda s: s.replace('<td>','').replace('</td>','').lower()
- content=content.split('</thead>')[1].split('</table>')[0]
- for lines in content.split('<tr>'):
- st=lines.split('\n')
- if len(st)>2:
- data[rep(st[0])]=map(rep,st[1:4])
- for key, value in data.items():
- print key
- for i in value:
- print '\t=>', i
- print
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement