Finds the URL (href tag value) for an anchor inside a table row (tr element) that is passed through HTMLTr parameter.
Looping through all < td >s in passing < tr >
HTMLTr has to have full TR from < tr to < /tr>
Needs Frequency(), CutString3(), HTMLTagAttributeValue()
Function FindAncherURL_InHTMLRow(HTMLTr)
' Finds the first href for an anchor in an html row (tr)
' Looping through all <td >s in passing <tr >
' HTMLTr has to have full TR from < tr to < /tr >
' needs Frequency(), CutString3(), HTMLTagAttributeValue()
Rett = ""
ThisTDs = Frequency(HTMLTr, " <td ") ' How many columns do we have
ColTD = 1 ' ThisTDs
Do While ColTD <= ThisTDs
LastTD = CutString3(HTMLTr, ColTD, " <td ")
If VBInstr(" <a ", LastTD) > 0 Then
Rett = HTMLTagAttributeValue(LastTD, "a", "", "", "", "href")
Exit Do
End If
ColTD = ColTD + 1
Loop
ByeBye:
FindAncherURL_InHTMLRow = Rett
End Function
' Finds the first href for an anchor in an html row (tr)
' Looping through all <td >s in passing <tr >
' HTMLTr has to have full TR from < tr to < /tr >
' needs Frequency(), CutString3(), HTMLTagAttributeValue()
Rett = ""
ThisTDs = Frequency(HTMLTr, " <td ") ' How many columns do we have
ColTD = 1 ' ThisTDs
Do While ColTD <= ThisTDs
LastTD = CutString3(HTMLTr, ColTD, " <td ")
If VBInstr(" <a ", LastTD) > 0 Then
Rett = HTMLTagAttributeValue(LastTD, "a", "", "", "", "href")
Exit Do
End If
ColTD = ColTD + 1
Loop
ByeBye:
FindAncherURL_InHTMLRow = Rett
End Function
HTMLTr
Views 346
Downloads 39
CodeID
DB ID
ANmarAmdeen
610
Revisions
v1.0
Monday
March
4
2024