+ Reply to Thread
Results 1 to 2 of 2

VBA to control web page and scrape data

  1. #1
    Registered User
    Join Date
    10-18-2007
    Location
    The Great State of Texas
    Posts
    5

    VBA to control web page and scrape data

    Self-taught Excel VBA noob here.
    I have scowered the internet far and wide to get to the point I'm at right now - which is stuck.

    Through VBA I can launch Internet Explorer, load a web site, enter my search string into a field on the screen, click the web site's "Submit" button, and post the data of the resultant data table into an Excel Worksheet using a Web Query.

    Now I need to select the next page on the web site and have been unable to do so.
    Here's the web site: http://www.bcad.org/clientdb/?cid=1
    Enter the first two letters of your last name in the search field and hit enter.
    A page will load with the results. At the bottom right of the screen you'll see the hyperlinks to the other pages of the table. What is the code in VB to select those pages?

    I've tried this, and it doesn't work:
    URL = "http://www.bcad.org/clientdb/SearchResults.aspx?rtype=address&page" & cycle & " "
    IntExplApp.Navigate URL
    Do While IntExplApp.Busy
    Loop

    Also, if there's an easier way of collecting the table data than a web query I would love to know.

    Thanks in advance!
    Chris

  2. #2
    Forum Contributor
    Join Date
    07-13-2007
    Posts
    151

    Get to next page

    Not sure what your variable CYCLE is in the example above, but if doesn't have an = sign at the front of it, I can see why it fails.

    Try this as your URL for Page 2, and then do the .navigate bit.

    http: //www.bcad.org/clientdb/SearchResults.aspx?rtype=address&page=2

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1