爬href链接

121

a = '<a href = "#" qoo = 123 abc = 456> I am a link </a>'
soup2 = BeautifulSoup(a,'html.parser')
print(soup2.select('a')[0]['href'])
print(soup2.select('a')[0]['abc'])
存储是以字典形式存储

输出

#
456

后序待补充

posted @ 2017-04-07 21:03  Lawliet__zmz  阅读(160)  评论(0编辑  收藏  举报