• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 131
  • Last Modified:

Opening multiple webpages

Hello Experts. I have a browser control through which I want to open many web pages, one at a time, wherein I will search for information that may have changed. I don't need help with how to search for the info I'm looking for. What I need your help with is how to go through one page at a time, waiting till the seach therein is done before moving on to the next URL. I've gotten very rusty working with Arrays, so I'll need some extra attention here. This page seems to be onto something, but I need more elaboration:
http://www.experts-exchange.com/Programming/Programming_Languages/Visual_Basic/Q_20177242.html?query=browser+control+loop+through+links&topics=93#6449318

Many kind thanks in advance,
John
0
John Account
Asked:
John Account
  • 2
1 Solution
 
jimbobmcgeeCommented:
A very basic example, using the WebBrowser control, is to try the following (using a form -- Form1, with a button -- Command1 -- and a WebBrowser -- WebBrowser1):

    Sub Command1_Click()
        Dim szURL as Variant, a_szURLs As Variant
        Set a_szURLS = Array("http://www.mydomain.com/page1.htm", _
                                         "http://www.mydomain.com/page2.htm", _
                                         "http://www.mydomain.com/page3.htm", _
                                         "http://www.mydomain.com/page4.htm")

        For Each szURL In a_szURLs                                                                           'LOOP THROUGH THE URLS
            WebBrowser1.Navigate2 szURL                                                                   'LOAD THE URL
            Do Until (WebBrowser1.ReadyState = 4) And (WebBrowser1.Busy = False)    'ALLOW PAGE TO LOAD
                DoEvents
            Loop
            DoYourCheck()
        Next szURL
    End Sub

    Sub DoYourCheck()
        'YOUR CHECK CODE GOES HERE
    End Sub

HTH

J.
0
 
John AccountAuthor Commented:
Getting a Type Mismatch on that array.
0
 
jimbobmcgeeCommented:
Take out the Set command:

    a_szURLs = Array(...)

J.
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now