Hi here is how my page looks like
<div class="Bango 1 Beamer Beamer-1"> Beamer </div>
<div class ="menu1"> menu1 </div>
<div class ="menu2"> menu2 </div>
<div class ="menu3"> menu3 </div>
<div class ="menu4"> menu4 </div>
<div class="Bango 1 Beamer Beamer-2"> Beamer2 </div>
<div class ="menu1"> menu21 </div>
<div class ="menu2"> menu22 </div>
<div class ="menu3"> menu23 </div>
<div class ="menu4"> menu24 </div>
<div class="Bango 1 Beamer Beamer-3"> Beamer3 </div>
<div class ="menu1"> menu31 </div>
<div class ="menu2"> menu32 </div>
<div class ="menu3"> menu33 </div>
<div class ="menu4"> menu34 </div>
How can I extract only elements under Beamer-1 only ? Note the number of elements under this group may also vary from time to time. Thanks
I suggest solving this issue with a number of pseudo-URLs:
' get bounds
URL GOTO=javascript:{var<SP>doc=window.document;var<SP>els=doc.getElementsByTagName("div");for(i=0;i<els.length;i++){var<SP>b=(els[i].outerHTML.match("Beamer-1"))<SP>?<SP>(i+1)<SP>:<SP>b;var<SP>e=(els[i].outerHTML.match("Beamer-2"))<SP>?<SP>i<SP>:<SP>e;}}
' set extract
URL GOTO=javascript:{var<SP>ext="";for(i=b;i<e;i++){ext+=els[i].innerHTML.trim()+((i==e-1)<SP>?<SP>""<SP>:<SP>"[EXTRACT]");}underfined;}
' create dummy element
URL GOTO=javascript:{var<SP>elt=doc.createElement("input");elt.type="hidden";elt.id="myHiddenExtract";elt.value=ext;doc.getElementsByTagName("html")[0].appendChild(elt);underfined;}
' get extract
TAG POS=1 TYPE=INPUT ATTR=ID:myHiddenExtract EXTRACT=TXT
' remove dummy element
URL GOTO=javascript:{doc.getElementsByTagName("html")[0].removeChild(doc.getElementById("myHiddenExtract"));underfined;}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With