LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default saving website html as string

I'm using code I found here (thank you) to load the html source of a
website into a string. My problem is that it doesn't always return the
entire webpage. Sometimes I only get a partial / incomplete version of
the html. Is there any way to make sure I get it all or to throw an
error if Internet Explorer didn't get the whole page? Maybe I could
just search for "</html" in the string and then recall the function if
it's not found, but there could be more than one </html in a webpage's
source or there could be text after it I would miss. Anyone have a
better idea? Thanks. Here's the code:

Public Function sGetHTML(rsURL As String) As String
Dim objIE As Object
Set objIE = CreateObject("InternetExplorer.Application")
With objIE
.Navigate rsURL
Do Until Not .Busy
DoEvents
Loop
With .document
If Not (.URL Like "res*") Then sGetHTML =
..documentelement.innerhtml
End With
.Quit
End With
Set objIE = Nothing
End Function

 
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
saving as html Kelly******** Excel Discussion (Misc queries) 0 April 18th 08 07:46 PM
Copying HTML Data From Website problem Smish Excel Discussion (Misc queries) 1 February 20th 07 04:11 PM
saving ppt as html [email protected] Excel Discussion (Misc queries) 0 September 9th 05 02:20 PM
Saving in html Peco Worker Links and Linking in Excel 1 April 1st 05 07:21 AM
Saving in html Peco Worker Excel Discussion (Misc queries) 0 March 30th 05 09:31 PM


All times are GMT +1. The time now is 07:12 AM.

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

About Us

"It's about Microsoft Excel"