3. XPathXML ã HTML ã®ä»»æã®ä½ç½®ãåå¾ããããã®å¼XPathã¨ã³ã¸ã³ãããã°ã XPathãæå®ã㦠HTML ä¸ã®å¤ãç°¡åã«æã£ã¦ããã 4. XPath<?php$url = 'http://www.nicovideo.jp/';libxml_use_internal_errors(true);$doc = new DOMDocument();$doc->loadHTML(file_get_contents($url));libxml_clear_errors();$xpath = new DOMXPath($doc);foreach ($xpath->query('//a') as $node) { echo $node->textContent . "";}
{{#tags}}- {{label}}
{{/tags}}