我用beautifulsoup提取class的多个属性值,但['fa', 'fa-address-book-o']不是我想要的结果。from bs4 import BeautifulSouphtml = "<i class='fa fa-address-book-o' aria-hidden='true'></i>"soup = BeautifulSoup(html, "lxml")h2 = soup.select("i")print(h2[0]['class'])我希望效果如下:fa fa-address-book-o
添加回答
举报
0/150
提交
取消