php - 求正規循環匹配
高洛峰
高洛峰 2017-05-16 13:16:57
0
4
438
 <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...

該怎麼寫呢?

高洛峰
高洛峰

拥有18年软件开发和IT教学经验。曾任多家上市公司技术总监、架构师、项目经理、高级软件工程师等职务。 网络人气名人讲师,...

全部回覆(4)
世界只因有你

雷雷

刘奇

用正規弄這個感覺好繁瑣,能不能直接查找標籤像下面這樣:

var a = document.querySelectorAll('a');
        a.forEach((item)=>{
            console.log(item.innerText);
        })
刘奇

雷雷

熱門教學
更多>
最新下載
更多>
網站特效
網站源碼
網站素材
前端模板
關於我們 免責聲明 Sitemap
PHP中文網:公益線上PHP培訓,幫助PHP學習者快速成長!