在线观看不卡亚洲电影_亚洲妓女99综合网_91青青青亚洲娱乐在线观看_日韩无码高清综合久久

鍍金池/ 問答/Python  HTML/ pyspider爬蟲結(jié)果獲取data-bgimage屬性值

pyspider爬蟲結(jié)果獲取data-bgimage屬性值

 <a href="testtese" target="_blank" data-bgimage="testtese"></a>

爬蟲獲取到的a標(biāo)簽中有href、target、data-bgimage等屬性,用this.attr.href和this.attr.target均能獲取到值,但是this.attr.data-bgimage會報global name 'bgimage' is not defined錯誤,求解

回答
編輯回答
淺時光

用this.attr["data-bgimage"]

2017年12月4日 09:57