Selecting Multiple Classes from an ID selection

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP


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&euro;</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&euro;</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&euro;</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&euro;</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.

Popular posts from this blog

Makefile test if variable is not empty

Will Oldham

'Series' object is not callable Error / Statsmodels illegal variable name