Having a hard time getting data from HTML using ie

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
datastudy
Posts: 4
Joined: 29 May 2023, 19:20

Having a hard time getting data from HTML using ie

Post by datastudy » 29 May 2023, 19:41

My data structure

Code: Select all


<span class="valuen">
<a href="/fil/44.htm">Item 1</a>
</span>
<br>
a yact and (
<i>Deck</i>
) floating bt..
<span class="valuen">
<a href="/fil/54.htm">Item 2</a>
</span>
<br>
the item can also ok.

I am trying to get the data under br (regardless how many lines it has) as long as it did not reach the next span class valuen

I am using

Code: Select all

ie := ComObjCreate("InternetExplorer.Application")
The page loads well, and the only problem with my current code is that if under the br is more than one line of text, it only gets the first line

Code: Select all

ie := ComObjCreate("InternetExplorer.Application")
ie.Visible := true  
ie.Navigate("https://...") 
WaitForLoad2(ie)

itms := ie.document.querySelectorAll(".valuen").length
dat := ie.document.querySelectorAll(".valuen")
loop, % itms
{
   

   msgBox, % dat[a_index-1].nextSibling.nextSibling.nodeValue


}
If there a way to loop the node and get data as long as the classname didn't check? I need some help here please


[Mod edit: Change code box types from HTML5 to AHK for relevant boxes.]

datastudy
Posts: 4
Joined: 29 May 2023, 19:20

Re: Having a hard time getting data from HTML using ie

Post by datastudy » 30 May 2023, 18:27

nobody can help me?

Post Reply

Return to “Ask for Help (v1)”