$store = curl_exec($ch); // Returns a page of HTML
$doc = new DOMDocument();
$doc->loadHTML($store);
$xpath = new DOMXpath($doc);
Vardump $xpath
"(개체 값이 생략)은"DOMXPath를 위해서 var_dump :
object(DOMXPath)#2 (1) {
["document"] => string(22) "(object value omitted)"
}
여기에 어떤 문제가 있습니까? HTML 코드에 xpath를 사용하여 정보를 추출하려고합니다.
object(DOMDocument)#1 (34) {
["doctype"] => string(22) "(object value omitted)"
["implementation"] => string(22) "(object value omitted)"
["documentElement"] => string(22) "(object value omitted)"
["actualEncoding"] => string(6) "gb2312"
["encoding"] => string(6) "gb2312"
["xmlEncoding"] => string(6) "gb2312"
["standalone"] => bool(true)
...
을 사용하는 것입니다 ... XPath는 DOM에 대한 검색 엔진입니다 문서, **로드하지 않은 문서 **입니다. –