Selecting Multiple Classes from an ID selection
Selecting Multiple Classes from an ID selection
I have the following XML
<div id="Master25" class="open-pane" role="tabpanel">
<a href="/option1" title="option1" class="top-element ">
<div class="top-element-description">
<div class="top-element-option-title">Spain</div>
<div class="top-element-option-description">Test1</div>
</div>
<span class="top-element-price">23€</span>
</a>
<a href="/option2" class="top-element ">
<div class="top-element-description">
<div class="top-element-option-title">Greece</div>
<div class="top-element-option-description">Test2</div>
</div>
<span class="top-element-price">25€</span>
</a>
<a href="/option3" class="top-element ">
<div class="top-element-description">
<div class="top-element-option-title">Germany</div>
<div class="top-element-option-description">Test3</div>
</div>
<span class="top-element-price">26€</span>
</a>
<a href="/option4" class="top-element ">
<div class="top-element-description">
<div class="top-element-option-title">Austria</div>
<div class="top-element-option-description">Test4</div>
</div>
<span class="top-element-price">29€</span>
</a>
How do I make the selector so that I get:
1 Answer
1
How about a child selector?
a > div
If I test in Jsoup online
With your input I get:
Spain Test1
Greece Test2
Germany Test3
Austria Test4
By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.