If I have an HTML document, what is the best way to go through the document and gather the href values from all anchor tags with a particular class using PHP?
1条回答 默认 最新
dtwk6019 2010-07-12 21:19关注See soulmerge's answer to "Preg_match_all href". Adjust the XPath to
//a[@class="foo"]/@hrefto get a DOMNodeList of all href attributes belonging to elements with a class of
foo.本回答被题主选为最佳回答 , 对您是否有帮助呢?解决 无用评论 打赏 举报