I'm trying to scrap information from a website. I am able to scrap inner and outer text from my class and i can save it into my array MyTable[]. However, i would like to save in the column 3 only the url existing inside the href : this is not working. The url is also save inside my column 2 with the outerText but whith a lot of other useless information. The idea here, is when i will have only the url inside column 3, i will be able to automatically navigate to this url with my code.
Here is an example of html code :
Code: Select all
<div class="AAA" id="AAAid">
<a tabindex="-1" class="BBB" aria-hidden="true" href="https://example_url_site_;
</a>
Code: Select all
group := "https://www.XXXXXXXX_URL_XXXXXXXXXX"
pwb.Navigate(group) ;Navigate to URL
while pwb.busy or pwb.ReadyState != 4 ;Wait for page to load
Sleep, 100
clearfix := pwb.document.getElementsByTagName( "DIV" )
MyTable := []
col = 1
row = 1
While ( a_index-1 < clearfix.length )
{
col = 1
if ( clearfix[ a_index-1 ].className = "AAA" )
{
MyTable[row , col] := Trim( clearfix[ a_index-1 ].innerText, " " )
col++
MyTable[row ,col] := Trim( clearfix[ a_index-1 ].outerHTML, " " )
col++
MyTable[row ,col] := Trim( clearfix[ a_index-1 ].outerHTML.href, " " )
row++
}
}
Thank you for the help !