M
M
Mykola2014-06-12 22:21:27
PHP
Mykola, 2014-06-12 22:21:27

Where is the mistake? xpath condition

<div class="spaceit_pad">
<span class="dark_text">English:</span>
Berserk: The Golden Age Arc I - The Egg of the King
</div>
<div class="spaceit_pad">
<span class="dark_text">Synonyms:</span>
Berserk Movie, Berserk Saga, Berserk: Golden Age Arc I - Egg of the Supreme Ruler, The Golden Age Arc I: The High King's Egg
</div>
<div class="spaceit_pad">
<span class="dark_text">Japanese:</span>
 ベルセルク 黄金時代篇Ⅰ 覇王の卵
</div>
<br />

In general, I want to parse the names, but in view of the fact that sometimes English may not be available, the option with indexes does not work. Therefore, I try to get it like this:
//*[@id="content"]/table/tr/td[1]/div[span="Synonyms:"]
But I get the value like this: "Synonyms:
Berserk Movie, Berserk Saga, Berserk: Golden Age Arc I - Egg of the Supreme Ruler, The Golden Age Arc I: The High King's Egg" but I don't need the word "Synonyms:" itself.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
Pavel Shorokhov, 2014-06-27
@comm1x

What are the names? And what does it mean - there can be no English?
For your option, labels:
And values:
Pull the value of the found node from the sheet:
DOMNodeList::item(0)->nodeValue;

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question