Greetings,
i have list of URL and created another column with HTML code. Another column i want to parse this HTML code to get specific data, but still can't get it to work. My code looks like:
<div class="desc">
<p class="top"><strong>Garance spokojenosti:</strong> 30 dní na vrácení zboží!</p>
<p class="top">V ceně zahrnuto:<br></p>
<ul>
<li>sluneční brýle</li>
<li><span class="originalCase infoButton2">Dárek zdarma: originální pouzdro<div class="over" style="margin-left: -106.5px;"><img src="xxx.png"></div></span></li>
<li>záruka vrácení peněz do 30 dnů</li>
</ul>
<a href="http://.cz/do-kosiku/740/" class="btn btn-pink btn-small to-basked pull-right">
Koupit </a>
<span class="pull-right price">
<meta itemprop="price" content="1 883">
<strong>1 883</strong>
<meta itemprop="priceCurrency" content="Kč">
Kč </span>
<span class="pull-right stockInfo" style="width:auto;">
Skladem </span>
</div>
<p class="top">Cena brýlí bez skel</p>
<a href="http://.cz/do-kosiku/740/1" class="btn btn-pink btn-small to-basked pull-right">
Koupit </a>
<span class="pull-right price">
<meta itemprop="price" content="1 483">
<strong>1 483</strong>
<meta itemprop="priceCurrency" content="Kč">
Kč </span>
<span class="pull-right stockInfo" style="width:auto;">
Skladem </span>
</div>
</div>
If i try:
value.parseHtml().select("div[class=desc]")
i get whole DIV as expected
with:
value.parseHtml().select("p[class=top]")
i get only one P.top, but there are more
But with:
value.parseHtml().select("div[class=priceItem]")
value.parseHtml().select("div[class=priceItem]")[0]
i get nothing or error
Can somebody explain, how to target elements? I need parse price in tag strong. But i want to understand it generally.
Thanks for help or link to explain. I found a lot of tips, but nothing describes why it works only for some elements.