如何通过名称获取select标记的php DOMDocument xpath
我有以下html:如何通过名称获取select标记的php DOMDocument xpath,php,xpath,domdocument,Php,Xpath,Domdocument,我有以下html: <select type="text" name="City" value=""> <option>city1</option> <option>city2</option> <option>city3</option> 这是行不通的,我不明白为什么 比尔试试看 $nodeList = $xpath->query("//select[@name='City']/option"); $
<select type="text" name="City" value="">
<option>city1</option>
<option>city2</option>
<option>city3</option>
这是行不通的,我不明白为什么
比尔试试看
$nodeList = $xpath->query("//select[@name='City']/option");
$nodeList = $xpath->query("//select[@name='City']/option");