Podczas próby parsowania html za pomocą Yahoo Query Language i funkcji xpath dostarczonej przez YQL, natknąłem się na problemy z nieodzyskaniem "text()" lub wartości atrybutów.
Dla np.
perma linkWypisywanie html przy użyciu Yahoo YQL
select * from html where url="http://stackoverflow.com"
and xpath='//div/h3/a'
podaje listę kotew jako XML
<results>
<a class="question-hyperlink" href="https://stackoverflow.com/questions/661184/filling-the-text-area-with-the-text-when-a-button-is-clicked" title="In ASP.net, I need the code to fill the text area (in the form) when a button is clicked. Can you help me through by showing a simple .aspx code containing the script tag? ">Filling the text area with the text when a button is clicked</a>...
</results>
Teraz, gdy próbuję wydobyć wartość węzła przy użyciu
select * from html where url="http://stackoverflow.com"
and xpath='//div/h3/a/text()'
dostaję wyniki łączone zamiast lista węzłów np
<results>Xcode: attaching to a remote process for debuggingWhy is b
…… </results>
Jak oddzielić go do listy węzłów i jak wybiorę atrybut wartości?
Zapytanie jak to
select * from html where url="http://stackoverflow.com"
and xpath='//div/h3/a[@href]'
dał mi takie same wyniki dla zapytań div/h3/a
Działa jak urok! – Cherian