+ Reply to Thread
Results 1 to 3 of 3

Retrieve information from already opened webpage?

  1. #1
    Registered User
    Join Date
    09-17-2009
    Location
    Ohio
    MS-Off Ver
    Excel 2007
    Posts
    9

    Question Retrieve information from already opened webpage?

    I currently use this macro to open the specific website and login (which I got from this forum and it works perfectly!! - as long as you enable/Reference Microsoft XML v4.0)

    Please Login or Register  to view this content.
    However...I would like to write another macro to extract information from this already opened webpage.
    I can't "CreateObject" again, because I'd have to login all over again...

    How could I start a macro, to reference the already opened webpage?

    Once I have logged in...the webpage is a 'search' screen. I have to search different 'cases' for specific bits of information.
    So would I continue to use ie.document.all.Item("txtUserName").Value to fill in different fields, like the case number?

    Once the 'case' screen is opened... what Code would I use to actually Extract information from the different fields?

    Can anyone help?

    Thanks!
    M

  2. #2
    Registered User
    Join Date
    09-17-2009
    Location
    Ohio
    MS-Off Ver
    Excel 2007
    Posts
    9

    Re: Retrieve information from already opened webpage?

    Bump...
    It's been a while...
    Anyone out there know how to automatically get info from the Internet into Excel?
    I'd be satisfied with just a general direction of help...
    Thanks!

  3. #3
    Valued Forum Contributor
    Join Date
    05-21-2009
    Location
    Great Britain
    MS-Off Ver
    Excel 2003
    Posts
    550

    Re: Retrieve information from already opened webpage?

    Quote Originally Posted by msy12 View Post
    I currently use this macro to open the specific website and login (which I got from this forum and it works perfectly!! - as long as you enable/Reference Microsoft XML v4.0)

    Please Login or Register  to view this content.
    However...I would like to write another macro to extract information from this already opened webpage.
    I can't "CreateObject" again, because I'd have to login all over again...

    How could I start a macro, to reference the already opened webpage?
    Have a search for ShellWindows (or Shell.Windows) which is a collection of windows, including all open IE windows and tabs.

    But why do you need a separate macro to pick up the already opened web page? Why not continue your existing macro, where the 'ie' variable is already referencing the IE browser open at your web site? The 'Click' method generates a navigate event, so you need to wait for the new page to load, using the same 'wait' code as shown earlier:
    Please Login or Register  to view this content.
    And then 'ie.document' references the logged in page.
    Once I have logged in...the webpage is a 'search' screen. I have to search different 'cases' for specific bits of information.
    So would I continue to use ie.document.all.Item("txtUserName").Value to fill in different fields, like the case number?
    Yes, using the appropriate HTML element id or name attribute (txtUserName in your example).
    Once the 'case' screen is opened... what Code would I use to actually Extract information from the different fields?
    Usually the same as filling in fields, by referencing the HTML id or name of the field, except put the reference on the right-hand side of the equals sign, like this:
    Please Login or Register  to view this content.

+ 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