Forum Discussion
programdoubts
12 years agoContributor
Hi Folks,
pls help me in this issue, its an urgent for me
Example: Page contains the below html code
Code which i have written right now for getting links from a web page is shown below
the above code is working fine, happy with this but the problem here is
but i dont want all the links in a page, i want only the links which is under specific div/ panel tag, for that i have tried as below way by including
object but its throwing and error
pls help me in this issue, its an urgent for me
Example: Page contains the below html code
<div id="firstDiv">
<a href="1"> 1 </a>
<a href="2"> 2 </a>
<a href="3"> 3 </a>
</div>
<div id="secondDiv">
<a href="1"> 1 </a>
<a href="2"> 2 </a>
<a href="3"> 3 </a>
</div>
Code which i have written right now for getting links from a web page is shown below
Sub Test
Dim page, links, linksCount, link, URL, i
URL = "http://10.10.1.20:7272/Web/WashingtonWeb/DataTables/DataTablesLanding.aspx?appid=450"
Browsers.Item(btIExplorer).Run(URL)
Set page = Sys.Browser("*").Page("*")
' Obtains the links
Set links = page.contentDocument.links
linksCount = links.length
If linksCount > 0 Then
For i = 0 To linksCount - 1
Set link = links.item(i)
URL = link.id
Log.Message(URL)
Next
End If
End Sub
the above code is working fine, happy with this but the problem here is
but i dont want all the links in a page, i want only the links which is under specific div/ panel tag, for that i have tried as below way by including
Panel("ObjectIdentifier","Menutagname1_datatablestree")
object but its throwing and error
Browsers.Item(btIExplorer).Run(URL)
Set page = Sys.Browser("*").Page("*").Panel("ObjectIdentifier","Menutagname1_datatablestree")
' Obtains the links
Set links = page.contentDocument.links
linksCount = links.length
can any 1 plsss help me, thanks in advance
Related Content
- 5 years ago
Recent Discussions
- 2 days ago