开发者

Question about downloading webpages using PHP

开发者 https://www.devze.com 2023-02-28 10:27 出处:网络
I am trying to download a bunch of webpages from this website: http://community.giffgaff.com/ However, when I try to download the webpages, the webpages I downloaded using PHP and the ones I saw in

I am trying to download a bunch of webpages from this website:

http://community.giffgaff.com/

However, when I try to download the webpages, the webpages I downloaded using PHP and the ones I saw in browser are different. It seems that the ones that I downloaded missed a large part of the original one.

Thanks!

To be more specific, below is one webpage that I am trying to download:

http://community.giffgaff.com/t5/user/viewprofilepage/user-id/120035

Out of the whole webpage, I am especially interested in the "My Recent Kudos Received" sesssion, but I can't find it anywhere in the source code of the webpage, or any link that direct me to other webpages containing related information.

The code I use for downloading is pretty basic, and it works well for other webpages.

<?php

$link=mysql_connect("localhost","root","");
if (!$link) {
 die('Could not connect: ' . mysql_error());

echo 'Connected successfully';}


function project($link)
{   
    set_time_limit(0);

    {
        $threadurl="http://co开发者_开发技巧mmunity.giffgaff.com/t5/user/viewprofilepage/user-id/120035";
        $lhandle=fopen($threadurl,'r');
        while(!feof($lhandle))
        {

            $gread=fgets($lhandle,4096);
            echo $gread;

        }
    }

}
project($link);


?>


The browser might check the signature of the browser, which performed the request - and send different output, e.g. for IE or iPhone mobile Webkit.

I just requested the page using PHP on MAMP on an iMac and using Safari. Seem to be different.

0

精彩评论

暂无评论...
验证码 换一张
取 消