<dd class="iqiyi"><a href="http://www.iqiyi.com/v_19rrbc8ups.html" target="_blank">20170408$http://www.iqiyi.com/v_19rrbc8ups.html</a></dd><dd class="iqiyi"><a href="http://www.iqiyi.com/v_19rrbd47ic.html" target="_blank">20170407$http://www.iqiyi.com/v_19rrbd47ic.html</a></dd><dd class="iqiyi"><a href="http://www.iqiyi.com/v_19rrnfp1nk.html" target="_blank">20170407$http://www.iqiyi.com/v_19rrnfp1nk.html</a></dd><dd class="iqiyi"><a href="http://www.iqiyi.com/v_19rrbcsn9g.html" target="_blank">20170406$http://www.iqiyi.com/v_19rrbcsn9g.html</a></dd>
我想要循環取得裡面a標籤裡的value,如:
20170408$http://www.iqiyi.com/v_19rrbc...
20170407$http://www.iqiyi.com /v_19rrbd...
該怎麼寫呢?
怪我咯2017-05-16 13:18:57
用正規弄這個感覺好繁瑣,能不能直接查找標籤像下面這樣:
var a = document.querySelectorAll('a');
a.forEach((item)=>{
console.log(item.innerText);
})