For Programmers: Free Programming Magazines  


Home > Archive > PHP Programming > March 2007 > cURL and Loading Pages









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author cURL and Loading Pages
Aaron

2007-03-27, 7:00 pm

I'm working on a program the goes out to a website and pulls down some
data using cURL. The page I'm pulling from has a loading screen
before the data I want is displayed. The code I have so far is
grabing this loading page instead of the fullly loaded page. Is there
anything I can do? Below is the code I have so far.

$ch= curl_init();
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_HEADER,0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_URL,$url);
$result = curl_exec($ch);

Martin Mandl - m2m tech support

2007-03-28, 4:00 am

On Mar 27, 4:29 pm, "Aaron" <A...@flasemi.com> wrote:
> I'm working on a program the goes out to a website and pulls down some
> data using cURL. The page I'm pulling from has a loading screen
> before the data I want is displayed.


Dear Aaron,

I would contact the webmaster of that side, if they can provide the
content in a different way. If they have no other way, they properly
do not want you to grab their content.

Good luck
Martin

Manuel Lemos

2007-03-29, 4:02 am

Hello,

on 03/27/2007 11:29 AM Aaron said the following:
> I'm working on a program the goes out to a website and pulls down some
> data using cURL. The page I'm pulling from has a loading screen
> before the data I want is displayed. The code I have so far is
> grabing this loading page instead of the fullly loaded page. Is there
> anything I can do? Below is the code I have so far.
>
> $ch= curl_init();
> curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
> curl_setopt($ch, CURLOPT_POST, 1);
> curl_setopt($ch, CURLOPT_HEADER,0);
> curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
> curl_setopt($ch, CURLOPT_URL,$url);
> $result = curl_exec($ch);
>


Maybe if you tell what is the URL we can provide better advice.

--

Regards,
Manuel Lemos

Metastorage - Data object relational mapping layer generator
http://www.metastorage.net/

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/
Satya

2007-03-30, 3:59 am

On Mar 27, 10:29 am, "Aaron" <A...@flasemi.com> wrote:
> I'm working on a program the goes out to a website and pulls down some
> data using cURL. The page I'm pulling from has a loading screen
> before the data I want is displayed. The code I have so far is
> grabing this loading page instead of the fullly loaded page. Is there
> anything I can do? Below is the code I have so far.
>
> $ch= curl_init();
> curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
> curl_setopt($ch, CURLOPT_POST, 1);
> curl_setopt($ch, CURLOPT_HEADER,0);
> curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
> curl_setopt($ch, CURLOPT_URL,$url);
> $result = curl_exec($ch);


Pages will come as they are programmed. you can send second request
after the first request.
Grab the header/cookie from first page and send them along with the
url for second page.

And last is there is no full proof solution for these kind of thing if
the site you are trying is not made for that. but generally you will
get success, if that is not login protected.

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com