Results 1 to 3 of 3

Thread: Autonomous IE

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Nov 2005
    Posts
    169

    Arrow Autonomous IE

    I would like to autonomously access a web page, parse the document and do what I need to do with the collected data. The IE window will be invisible to the user therefore I need to detect any errors associated with a bad URL or a inaccessable page, etc..

    For example: If I navigate to the page and encounter a 404 error, then I would not parse.

    HOW DO I ACCOMPLISH THIS?? I can't find a property that would hold such HTTP status codes in the IE object.


    'example code:

    Dim IE as New InternetExplorer
    Dim Doc as New HTMLDocument


    IE.Navigate "www.myURL.com", navNoReadFromCache

    'i will start a timer here and IE.STOP if things take too long
    timer1.interval = 30000
    timer1.enabled = true

    Do Until IE.ReadyState = READYSTATE_COMPLETE
    if userStopFlag = true then
    IE.STOP
    exit sub
    endif
    Loop

    timer1.enabled = false

    'HERE IS WHERE I WANT TO EXAMINE TO SEE IF I REALLY
    'HAVE SOMETHING TO PARSE, MAYBE THE URL IS BAD OR
    'WHATEVER, I WANT TO KNOW IF THERE ARE ANY ERRORS
    'BEFORE I PARSE. Such as 503, 404, etc....


    'If we get here then we can begin document processing.
    Last edited by vb_lover; May 23rd, 2010 at 09:00 AM.

  2. #2
    Fanatic Member
    Join Date
    Nov 2007
    Posts
    520

    Re: Autonomous IE

    I believe WebBrowser1.DocumentText.Tostring holds the source code of the page.

    Not 100% sure, but i know its one of those.

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Nov 2005
    Posts
    169

    Re: Autonomous IE

    Quote Originally Posted by TCarter View Post
    I believe WebBrowser1.DocumentText.Tostring holds the source code of the page.

    Not 100% sure, but i know its one of those.

    Hi,
    I was looking for a status code returned from the server, I didn't want to have to parse the document for error codes. I found that in some cases a status code is not visible in the document. I was hoping the server returned a numerical code other than imbedded in the document.

Posting Permissions

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



Click Here to Expand Forum to Full Width