Download A "Cloaked" Web Page...-VBForums
Results 1 to 6 of 6

Thread: Download A "Cloaked" Web Page...

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Sep 2013
    Posts
    190

    Question Download A "Cloaked" Web Page...

    VB6
    Win7

    I have the code to download a web page, but if you were to use a URL such as "https://www.facebook.com/groups/RealFunnyStuff/", it is not the entire page. The file size ends up being around 2KB, enclosed with a redirect to the actual page.

    The code I am using is this:

    Code:
    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
    
    Public Function DownloadFile(URL As String, _
        LocalFilename As String) As Boolean
        Dim lngRetVal As Long
        lngRetVal = URLDownloadToFile(0, URL, LocalFilename, 0, 0)
        If lngRetVal = 0 Then DownloadFile = True
    End Function
    Calling like this:

    Code:
    DownloadFile "https://www.facebook.com/groups/RealFunnyStuff/", "C:\Lab\test.htm")
    (and no, it doesn't matter whether I have http, https, or www for the url beginning)

    I would like to download the entire page. How can I do this?

  2. #2
    PowerPoster
    Join Date
    Feb 2012
    Location
    West Virginia
    Posts
    12,138

    Re: Download A "Cloaked" Web Page...

    Well if it is using a redirect at some point then it is actually more than one page

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Sep 2013
    Posts
    190

    Re: Download A "Cloaked" Web Page...

    There is a link inside the file that, if copied and pasted into a browser, will pull up the same thing. The link is slightly different than the original. However, when using the new link to download the page, I get the same thing.

  4. #4

    Thread Starter
    Addicted Member
    Join Date
    Sep 2013
    Posts
    190

    Re: Download A "Cloaked" Web Page...

    *bump*

  5. #5
    PowerPoster Nightwalker83's Avatar
    Join Date
    Dec 2001
    Location
    Adelaide, Australia
    Posts
    13,346

    Re: Download A "Cloaked" Web Page...

    Quote Originally Posted by Conroy Vanderbluff View Post
    There is a link inside the file that, if copied and pasted into a browser, will pull up the same thing. The link is slightly different than the original. However, when using the new link to download the page, I get the same thing.
    When you say "Entire web page" do you mean you want to save as "Web Page, Complete"? That is save the text and images, etc on the page not just the text.
    when you quote a post could you please do it via the "Reply With Quote" button or if it multiple post click the "''+" button then "Reply With Quote" button.
    If this thread is finished with please mark it "Resolved" by selecting "Mark thread resolved" from the "Thread tools" drop-down menu.
    Please consider giving me some rep points if I help you a lot.
    Please rate my post if you find it helpful!
    Technology is a dangerous thing in the hands of an idiot! I am that idiot.

  6. #6
    Hyperactive Member
    Join Date
    Sep 2014
    Posts
    341

    Re: Download A "Cloaked" Web Page...

    I think I might have run into the same problem when using Inet. It turns out there are two versions of Inet.

    one is around 112k
    the other 130k

    When I used 112k version of inet, for some sites, I was only able to download a small portion of the HTML, incomplete.
    But the second version didn't have this problem.

    I haven't practiced downloading pages using API. But perhaps you can use something else.

    Sorry for being a newbie here not much help

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Featured


Click Here to Expand Forum to Full Width

Survey posted by VBForums.