Ich versuche, die XPath-Abfrage auf die Datei zu erhalten, die folgenden Zeilen enthält:Newbie XPath-Abfrage
<div id="pPrice">
<b>Preis</b>
<br/>
<div class="price" style="margin-top:2px">
<nobr>
<span class="price_info">Jetzt 48% sparen!</span>
<br/>
<span class="price_info">
Statt
<strike>30,60 €</strike>
<strong> nur</strong>
</span>
<strong>
<span class="productSpecialPrice">15,90 €</span>
</strong>
</nobr>
</div>
Als ich den ‚gekreuzt‘ Preis zu bekommen (Wert 30,60), verwende ich folgende, und es funktioniert gut:
.//*[@id='pPrice']/div[1]/nobr/span[2]/strike
Jetzt will ich bekommen die productSpecialPrice
(Wert 15,90 €) und ich versuchte dieses:
.//*[@id='pPrice']/div[1]/nobr/strong/span
Aber es funktioniert nicht. Wie soll ich das bearbeiten?
Danke!
UPD: Jetzt ist alles funktioniert gut, aber in diesem Fall:
<div id="pPrice">
<b>Preis</b>
<br/>
<div class="price" style="margin-top:2px">
<nobr>
<span class="price_info">Jetzt 33% sparen!</span>
<br/>
<span class="price_info">
Statt
<strike>41,70 €</strike>
<strong> nur</strong>
</span>
<strong>
<span class="productSpecialPrice">27,90 €</span>
</strong>
</nobr>
</div>
<div class="priceinfo">
inkl. gesetzl. MwSt zzgl.
<a class="priceinfolink" href="javascript:openShipping();">Versandkosten</a>
</div>
</div>
<div id="pAvailability">
<table width="100%" cellspacing="0" cellpadding="0" border="0">
</div>
<div id="pPrice">
<b>Preis für 2. Wahl Spiel</b>
<small>
<a href="JavaScript:var win=open('/zweitewahl.html', '', 'scrollbars=no,location=0,left=300, top = 100,toolbar=0,status=0,resize=0,width=400,height=310')">
</small>
<br/>
<div class="price" style="margin-top:2px">
<nobr>
<nobr>36,00 €</nobr>
</div>
<div class="priceinfo">
inkl. gesetzl. MwSt zzgl.
<a class="priceinfolink" href="javascript:openShipping();">Versandkosten</a>
</div>
Die Abfrage Rückkehr zwei Werte: '27, 9 € 'und '36 €'. Wie gebe ich in der Abfrage an, dass ich den Wert '27, 9 €' brauche?
Sie so viel Dank! – Dmitriy
Bitte markieren Sie diese Antwort als "Akzeptiert", wenn Ihr Problem dadurch gelöst wurde. Danke – Andersson
Erneut geöffnet die Frage, wie ich 2 Werte durch die Abfrage – Dmitriy