Reputation: 174
</script></form>
<div id='dle-content'><div class="news" itemscope itemtype="http://schema.org/Movie">
<div class="news_header">
<div class="title_right" >
<div class="rating">
<div class="rat_col_new" style="text-align:right" itemscope style="display:none;">1</span></span></div>
<ul class="unit-rating">
<li class="current-rating" style="width:78%;">78</li>
</ul>
</div>
Мистика Приключения Ужасы
MyCode PHP How to use it ?
elements that have the specified attribute and it starts with a certain value. [attribute$=value] Matches elements that have the specified attribute and it ends with a certain value. [attribute*=value] Matches elements that have the specified attribute and it contains a certain value.
Upvotes: 0
Views: 47
Reputation: 4695
Seems like you are running it in a loop? (with the $i) If you replace it with the index of the targeted elements, you get the one you want (i guess you want the first)
echo $htmlParser->find("/div#dle-content/div.news/div.news_header/div.title_left/a[href]", 0)->plaintext;
Upvotes: 1