-3
가능한 중복 :
How to parse and process HTML/XML with PHP?
Grabbing the href attribute of an A element정규식, 태그 사이의 모든 것을 얻는 방법?
어떻게 당신이 모든 것을 얻을 수는 태그 사이 : <td class="detail"></td>
? 나는 PHP를 사용한다.
가능한 중복 :
How to parse and process HTML/XML with PHP?
Grabbing the href attribute of an A element정규식, 태그 사이의 모든 것을 얻는 방법?
어떻게 당신이 모든 것을 얻을 수는 태그 사이 : <td class="detail"></td>
? 나는 PHP를 사용한다.
DOMXpath을 사용하지 않으시겠습니까? 정규식
$xpath = new DOMXPath(yourHtml);
$nodeList = $xpath->query("//td[@class='detail']");
foreach($nodeList as $node)
{
echo $node->nodeValue;
}
구문 분석 HTML은 권장되지 정규식 HTML을 구문 분석
일반적으로 좋은 선택이되지 않습니다 : http://stackoverflow.com/questions/1732348/regex-match-open-tags- except-xhtml-self-contained-tags가 있습니다. 귀하의 상황은 정말 구체적 일지 모르지만 받아 들여질 수 있습니다. –
행운을 빌어'/