Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 142
Default Problem with .navigate method

I am trying to read data from a website using the navigate method. The
website returns 40 data items of interest out of a total of 18,000 so I
have to read many times to get all 18,000 items.

The problem is that sometimes the data returned by Execel is incomplete
(only part of the html is returned). The problem does not appear to be the
website because only this happens when using Excel. Repeating the
identical attempt to read the data from the web will almost always give the
correct results. Rarely, I'll have to make 3 attempts to get it right.
Here is the code I am using:

Dim oie As Object
Dim i as Long
Dim Done as Boolean

Set oie = CreateObject("InternetExplorer.Application")
Done = False
i = 2
While Not Done
oie.Navigate "http://www.WebSiteOfInterest.com/" & ThisTimesReq(i)
oie.Visible = False
Do
Loop Until oie.ReadyState = 4
Range("A" & i) = oie.Document.body.outerhtml
If instr(Range("A" & i), "Data past what I'm looking for") = 0 then
i =i - 1
End If
i = i + 1
If SomeTestSaysWeAreDone then Done = True
Wend

The code above works only because , after each read, I look for html that
comes after all of the stuff I am interested in. If it is missing, I know
the read was incomplete and all of the info I need may not be there. By
setting i=i-1 another attempt is made to read the same data.

I am using Windows XP-Pro with all updates and Excel 2003 SP 2

QUESTIONS:
1. Is there something wrong with my code?
2. If not, is this a common Excel problem?
3. Is there another way to do this that is reliable so I don't have to
repeat failed attempts?

Many thanks for any help/
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem using SaveAs method Sujata Excel Discussion (Misc queries) 4 March 30th 10 07:21 AM
Problem with Find Method Edward Ulle Excel Programming 4 November 22nd 05 05:00 PM
Little problem with the REPLACE method. jase[_2_] Excel Programming 2 November 17th 05 01:53 PM
Problem with the FIND method looking for dates. jase[_2_] Excel Programming 2 November 14th 05 01:30 PM
Problem with find method Ralph Heidecke[_2_] Excel Programming 3 April 18th 05 08:07 PM


All times are GMT +1. The time now is 10:43 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"