$p = new DOMDocument();
echo $data;
$static = $p->loadHTML($data);
$static = $static->getElementByTagName("html")->item(0);
$static = $static->getElementByTagName("body")->item(0);
$static = $static->getElementByTagName("table")->item(0);
$static = $static->getElementByTagName("tr")->item(0);
$static = $static->getElementByTagName("td")->item(0);
$static = $static->getElementByTagName("table")->item(0);
$static = $static->getElementByTagName("tr")->item(5);
$static = $static->getElementByTagName("td")->item(1);
$static = $static->getElementByTagName("div")->item(0);
$static = $static->getElementByTagName("table")->item(0);
$static = $static->getElementByTagName("tr")->item(0);
$static = $static->getElementByTagName("td")->item(0);
$static = $static->etElementByTagName("center")->item(0);
echo $static;
내가 위의 코드를 잘 수행하고 있는지 확실하지 않지만, 필자가 원하는 부분을 찾기 위해 기본적으로 구조를 검토하고있는 것처럼 보인다. 나는이 오류가 계속하지만 (최초의 "getElementByTagName을"인 라인 18)PHP를 사용하여 HTML DOM 구조를 탐색하려고합니까?
Fatal error: Call to a member function getElementByTagName() on a non-object in blah on line 18
을 나는 또한 아무것도 그것으로 할 경우 이러한 오류를 얻을 :
Warning: DOMDocument::loadHTML() [domdocument.loadhtml]: Opening and ending tag mismatch: td and center in Entity, line: 83 in on line 17
Warning: DOMDocument::loadHTML() [domdocument.loadhtml]: Opening and ending tag mismatch: td and center in Entity, line: 83 in on line 17
Warning: DOMDocument::loadHTML() [domdocument.loadhtml]: Opening and ending tag mismatch: td and center in Entity, line: 87 in on line 17
Warning: DOMDocument::loadHTML() [domdocument.loadhtml]: Unexpected end tag : div in Entity, line: 91 in on line 17
을하지만, 그래 , 아무도 제발 도와 드릴까요?
아 사이트에 데이터를 가져 오는 중, 개인적으로 변경할 수있는 정보가 없습니다. 나는 HTML 오류를 없애 버렸지 만 아직도 그것을하고있다. 그러나 그것은 그것이 내가 필요로하는 것을 위해 정확히 작동 할 것처럼 보이기 때문에 지금은 중요하지 않습니다. 빠른 응답 주셔서 감사합니다 :) –
좋아, 지금은 그냥 이상한 평가로 같은 오류를 받고있어 보인다 회원 함수에 대한 호출() 비 객체에 –
좋아, 필자는 그것을 지금! 감사 :) –