DOM XPATH获取img src值的query
程序员文章站
2023-11-22 15:12:34
复制代码 代码如下:$nodes = @$xpath->query("//*[@id='main_pr']/img/@src");$prurl = $nodes-&g...
复制代码 代码如下:
$nodes = @$xpath->query("//*[@id='main_pr']/img/@src");
$prurl = $nodes->item(0)->nodevalue;