Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Drill down through the catalog
#1
Hi,
I have following problem:

I need to drill down through the catalog via all links.
Catalog has 4 levels and each level has few links.
I'm grabbing all links on the page then following each via 'Foreach' loop. But after I'm comming back I'm not able to following next one.

Can anybody correct my procedure?


Code:
Sub DrillDown (url, level, urlback) If level =1 Then SystemUtil.Run "C:\Program Files\Internet Explorer\iexplore.exe","","u:\","open" Browser("IE7").Page("Page").Sync Browser("IE7").Navigate url Browser("IE7").Page("Page").Sync Dim objNames Dim objName Dim blnFound End If If Browser("IE7").Page("Result").WebElement("div").Exist(2)Then level = 4 End If If level=1 Then Set objNames = Browser("IE7").Page("TGRMain").WebTable("CategoriesGrid").Object.getElementsByTagName("A") col = Level1 Elseif level = 2 Then Set objNames = Browser("IE7").Page("Groups").WebTable("CategoriesGrid").Object.GetElementsByTagName("A") col = Level2 Elseif level = 3 Then Set objNames = Browser("IE7").Page("Headings").WebTable("CategoriesGrid").Object.GetElementsByTagName("A") col = Level3 End If blnFound = False lngCellCount = 0 If level <> 4 Then For Each objName in objNames If level = 1 or level = 2 or level = 3 Then bu = Browser("IE7").GetROProperty("URL") objName.Click() Browser("IE7").Sync Call DrillDown(domain, level+1, bu) End if Next 'objName Else Browser("IE7").Navigate urlback Browser("IE7").Page("Page").Sync End If End Sub


Thank you
Reply
#2
not clear about your question. but something must be made clear.
The domain in Call DrillDown(domain, level+1, bu) should be referenced to TGRMain, Groups, Headings according to your code.
According to your code, there is one assumption: Click on the first level links(Page("TGRMain")) will navigate to the second level(Page("Groups")), and click on second level links will navigate to the third level(Page("Headings"))
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
Question Initial Catalog;Package Collection DB2 Charanpreet 0 3,405 05-06-2011, 03:56 PM
Last Post: Charanpreet

Forum Jump:


Users browsing this thread: 1 Guest(s)