Saving web pages to file using webBrowser or inet control 
Author Message
 Saving web pages to file using webBrowser or inet control

   I am using Visual Basic 5.0(sp3) under win95 and want to navigate to
a web page and download it to a text file.  (The resulting web page is a
plain text file).
   I use "webBrowser1.navigate sUrl" to go to the page and the page appears
ok, but how do I save this result to file.  I do not see an available
property or method for this.
   If I try to use the inet control using the command "inet1.openurl sUrl" I
get an http 404 error, file not found but I know the sUrl address is correct
because the webBrowser or netscape or IE display it correctly.
   The sUrl is
" http://www.*-*-*.com/ :443/930954003850?User=demo&Pswd=demo&DataType=DA...
bol=aol&Interval=60"
   I have also set the inet1.remotePort property to 443 but this still
results in a 404 error.
   Any suggestions on how to save this web page or similar pages to a file?


Fri, 21 Dec 2001 03:00:00 GMT  
 Saving web pages to file using webBrowser or inet control
hi,
try some lines like

Private Sub Yoursub_sub()

Inet1.AccessType = icUseDefault
    Dim b() As Byte
    Dim strURL As String

    'strURL has to be a valid one. xxx.xxx.xxx.xxx for the ip adr or

    'dns, yy for prt'

    strURL = "http://xxx.xxx.xxx.xxx:yy/" & _
    "your.file"

    ' to recive data as binary array.

    b() = Inet1.OpenURL(strURL, icByteArray)

    ' x for your drive

    Open "x:\path\dest.file" For Binary Access _
    Write As #1
    Put #1, , b()
    Close #1
End Sub



Quote:
>   I am using visual basic 5.0(sp3) under win95 and want to navigate to
>a web page and download it to a text file.  (The resulting web page is a
>plain text file).
>   I use "webBrowser1.navigate sUrl" to go to the page and the page appears
>ok, but how do I save this result to file.  I do not see an available
>property or method for this.
>   If I try to use the inet control using the command "inet1.openurl sUrl" I
>get an http 404 error, file not found but I know the sUrl address is correct
>because the webBrowser or netscape or IE display it correctly.
>   The sUrl is
>"http://204.71.198.40:443/930954003850?User=demo&Pswd=demo&DataType=DA...
>bol=aol&Interval=60"
>   I have also set the inet1.remotePort property to 443 but this still
>results in a 404 error.
>   Any suggestions on how to save this web page or similar pages to a file?



Sat, 22 Dec 2001 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Saving web page with images using the WebBrowser control

2. Saving web pages with WebBrowser control

3. Saving a complete Web Page from the WebBrowser control

4. Webbrowser control - Saving a web page

5. new problem of webbrowser control save web page

6. webbrowser control save web page

7. Saving Pages Using the WebBrowser Control ???

8. Saving Pages Using the WebBrowser Control ???

9. How can I save a web page to file using VBS

10. WebBrowser Ctl: save web page to local machine

11. Save WebBrowser's web page

12. Help saving web page with web control?

 

 
Powered by phpBB® Forum Software