I would like to know how to get content from a WEB page where I have several DIVs with the same IDs. One looks like the other, div 1
, it's like a Title, already the Div 2
as if it were the content ...
But the problem that div 2
can have several, one underneath the other, before coming to the next div 1
.
How do I get these divs with these IDs?
After I get this Div 2
, I have to check if the first element inside it has the class DIV_3
, if it has this element, I have to skip all divs 2
and go straight to the next div 1
...
I have an object, with all the HTML content of the site:
<div id="1"></div>
<div id="2">
<div class="3"></div>
<div class="10"></div>
</div>
<div id="2">
<div class="10"></div>
<div class="10"></div>
<div class="10"></div>
</div>
<div id="1"></div><!--Próxima DIV 1-->
Understand, first I need to separate all divisions of an object with the ID 1 e 2
:
After separating they would have an HTML similar to the one above (but with a lot more DIV 1 e Div 2
), so I have to do a check, if the first DIV 2
, has a DIV 3
inside it, I have which jump directly to the next DIV 1
...
I tried with find, but I did not succeed, first that find takes what's inside, and first I need to separate from the whole object, DIVs 1 e DIVs 2
...
If anyone can give a force ... ATT