Results 1 to 11 of 11

Thread: Not Downloading Whole HTML

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jul 1999
    Posts
    77
    I've made made simple internet Apps for home use.

    For some reason a html won't download fully off this one site. It only downloads a short part of the HTML.

    Any ideas why this is happening?

    Here's the Code:

    Dim b() As Byte
    Dim strURL As String
    Dim FileN
    strURL = "[HTML PAGE]"
    b() = Inet.OpenURL(strURL) 'icByteArray
    FileN = "C:\Windows\Temp\Test.html"
    Open FileN For Binary Access Write As #1
    Put #1, , b()
    Close #1
    Shell "C:\Program Files\Internet
    Explorer\IExplore.exe " & FileN, vbMaximizedFocus

    Any idea why???

    -Justin Gomes

  2. #2
    Frenzied Member
    Join Date
    Mar 2001
    Location
    You are HERE •™
    Posts
    1,300
    Are you sure it's a problem with your code? It could be a problem with the web-site. Have you compared the source of the web-site with what you are getting?

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Jul 1999
    Posts
    77

    Yeah I checked

    Yeah I checked the file
    It was not the complete HTML.

    I always check the Site after it dls the file.

    No Luck

    It seems to stop in the middle of the HTML.

    Is there anyway around this?

  4. #4
    Evil Genius alex_read's Avatar
    Join Date
    May 2000
    Location
    Espoo, Finland
    Posts
    5,538
    Well the :
    Shell "C:\Program Files\Internet
    Explorer\IExplore.exe " & FileN, vbMaximizedFocus
    needs to be on one line, though I guess that's just the way you put it into this post & it's different on your actual code ?

    You could try using the SHELLEXCECUTE API call : http://www.vbapi.com/ref/s/shellexecute.html

    Code:
    Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" _
    (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String,  _
    ByVal lpParameters As String, ByVal lpDirectory As String, _
    ByVal nShowCmd As Long) As Long
    
    shellexecute me.hwnd, "open", FileN
    Last edited by alex_read; Apr 7th, 2001 at 01:42 PM.

    Please rate this post if it was useful for you!
    Please try to search before creating a new post,
    Please format code using [ code ][ /code ], and
    Post sample code, error details & problem details

  5. #5

    Thread Starter
    Lively Member
    Join Date
    Jul 1999
    Posts
    77

    Yeah that's one line

    Yeah that's one line...

    I put that code in there to check if it dled the whole HTML...

    =(

  6. #6
    Frenzied Member JasonLpz's Avatar
    Join Date
    Mar 2001
    Location
    Brooklyn, NY
    Posts
    1,335
    i use this to save html files try it
    Code:
     On Error Resume Next
        WebBrowser1.ExecWB OLECMDID_SAVEAS, OLECMDEXECOPT_PROMPTUSER
    - JayWare
    Live to love. Not to Hate

    Im to busy to have a site. But I got one and still working on it.

    http://dre3k.net/

  7. #7

    Thread Starter
    Lively Member
    Join Date
    Jul 1999
    Posts
    77

    Using a HTML Browser...

    I want to stay away from using that object.

    For Performance....

    I know...I'm picky...

    Added This Info When edited:
    Another reason I'd want to stay away from that object is it loads all the images and other things inside the HTML.

    =(

  8. #8
    Frenzied Member
    Join Date
    Mar 2001
    Location
    You are HERE •™
    Posts
    1,300
    How about URLDownloadToFile API:

    Private Declare Function URLDownloadToFile Lib "urlmon" Alias _
    "URLDownloadToFileA" (ByVal pCaller As Long, ByVal szURL As String, ByVal _
    szFileName As String, ByVal dwReserved As Long, ByVal lpfnCB As Long) As Long

    The function can be called as follows:
    returnValue = URLDownloadToFile(0, "http://www.microsoft.com/ms.htm", _
    "c:\ms.htm", 0, 0)
    Note that when downloading HTML files, embedded content like images and objects will not be downloaded.

    Try this link below - This one talks about saving images.
    http://msdn.microsoft.com/workshop/e...52001.asp#save

    Hope that helps

  9. #9

    Thread Starter
    Lively Member
    Join Date
    Jul 1999
    Posts
    77

    Thx so Much...

    WOOOHOOO
    it works

    I thank you all for your time!!!

  10. #10

    Thread Starter
    Lively Member
    Join Date
    Jul 1999
    Posts
    77

    Uh oh...another problem...but I'll work on this one later

    If I run the API again it automatically uses the Page that is in Cache.

    How do I make it dl it again?

    This is no biggy...it has a flip side...that it is kind of good...

  11. #11
    Frenzied Member JasonLpz's Avatar
    Join Date
    Mar 2001
    Location
    Brooklyn, NY
    Posts
    1,335
    what are you using ?
    html Browser
    I dont get it
    - JayWare
    Live to love. Not to Hate

    Im to busy to have a site. But I got one and still working on it.

    http://dre3k.net/

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