|
-
May 22nd, 2010, 02:14 PM
#1
Thread Starter
Addicted Member
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.
-
May 28th, 2010, 12:17 PM
#2
Fanatic Member
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.
-
May 31st, 2010, 11:26 AM
#3
Thread Starter
Addicted Member
Re: Autonomous IE
 Originally Posted by TCarter
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|