Welcome !
         

 Script to download website

Author Message
dtrom26

  • Total Posts : 1
  • Scores: 0
  • Reward points : 0
  • Joined: 12/29/2016
  • Status: offline
Script to download website Thursday, December 29, 2016 8:15 AM (permalink)
0
Hi,
 
I am new to VB scripts but have managed to create the following code to download html files. However I want to also download the associated scripts and images associated with the html. Can anyone help?
 
Thank you
 ' Set your settings    strFileURL = "https://www.dailyfx.com/forex-rates"    strHDLocation = "c:\MACRO\prices\index.html"
' Fetch the file    Set objXMLHTTP = CreateObject("MSXML2.XMLHTTP")
    objXMLHTTP.open "GET", strFileURL, false    objXMLHTTP.send()
If objXMLHTTP.Status = 200 ThenSet objADOStream = CreateObject("ADODB.Stream")objADOStream.OpenobjADOStream.Type = 1 'adTypeBinary
objADOStream.Write objXMLHTTP.ResponseBodyobjADOStream.Position = 0    'Set the stream position to the start
Set objFSO = Createobject("Scripting.FileSystemObject")If objFSO.Fileexists(strHDLocation) Then objFSO.DeleteFile strHDLocationSet objFSO = Nothing
objADOStream.SaveToFile strHDLocationobjADOStream.CloseSet objADOStream = NothingEnd if
Set objXMLHTTP = Nothing
 

 
#1
    digifoss

    • Total Posts : 6
    • Scores: 0
    • Reward points : 0
    • Joined: 12/30/2016
    • Status: offline
    Re:Script to download website Friday, December 30, 2016 9:32 AM (permalink)
    0
    I am doing something similar and it pulls in the scripts on the web page I am using it on.  Getting the images will take something more.  I'm also green at pulling down from the web.
    ---------------------------------------
    Set http = CreateObject("Microsoft.XmlHttp")
    http.open "GET", URL, False
    http.send ""
    strAarrLines = http.responseText
     
    #2
      59cobalt

      • Total Posts : 2626
      • Scores: 253
      • Reward points : 0
      • Joined: 7/17/2011
      • Status: offline
      Re:Script to download website Friday, December 30, 2016 3:31 PM (permalink)
      0
      Use something like wget (Windows version available e.g. here) or HTTrack.
       
      #3
        Online Bookmarks Sharing: Share/Bookmark

        Jump to:

        Current active users

        There are 0 members and 2 guests.

        Icon Legend and Permission

        • New Messages
        • No New Messages
        • Hot Topic w/ New Messages
        • Hot Topic w/o New Messages
        • Locked w/ New Messages
        • Locked w/o New Messages
        • Read Message
        • Post New Thread
        • Reply to message
        • Post New Poll
        • Submit Vote
        • Post reward post
        • Delete my own posts
        • Delete my own threads
        • Rate post

        2000-2017 ASPPlayground.NET Forum Version 3.9