0
있어 구조 :PHP 간단한 HTML DOM 파서 LI 요소를 찾아이 같은
<div class="info">
<ul class="info-fields">
<li style="display: none">
<span style="display:none" itemprop="brand">Text</span></li>
<li>Name: <h1 style="font-size: 14px;margin: 0px;display: inline;"><strong>Demo</strong></h1></li>
<li>Genre: <a href="url">text 1</a>, <a href="url">text 2</a></li>
<li>Country: <a href="url">text 3</a>, <a href="url">text 4</a></li>
<li>Duration: 02:53</li>
<li>Studio: <a href="url">Disney</a></li>
<li>Models: <a href="url" >text 5</a>, <a href="url">text 6</a></li>
</ul>
</div>
는 = A HREF 그것을 "URL을"<을 얻는 방법> 텍스트 1, < A HREF = "URL"> 텍스트 2 </A>
감사
<li>Genre: <a href="url">text 1</a>, <a href="url">text 2</a></li>
,
내 코드
$tagss = $html->find('ul.info-fields li:nth-child(3) a');
$args_tags = array();
foreach($tagss as $element)
{
$tag1 = $element->plaintext;
array_push($args_tags, $tag1);
}
내가 편집 한 .... –
당신의'ul' 클래스 filminfo-fields'하는'해야'잘못 info-fields' html을 기반으로합니다 – nerdlyist
죄송합니다, 잘못 작성했습니다. 정보 필드를 수정했지만, 모든 카드를 가져옵니다. info-fields에 –