|
|
Posted by DJ Majestik on 01/14/06 16:00
I am trying to login to a particular site, login, then do a screen
scrape after the "session" is logged in with curl. The screen scrape
with curl works, and the login with curl (as a post) works, but when I
put them together using the same $ch, the screen scrape is of the html
that is not logged in. Here is a snippet of code, if anyone can give m
advice how to do this I would appreciate it. Thanks!
JJ
$email = 'email';
$pass = '*****';
$submit = "Log In";
$curlPost = 'email=' . urlencode($email) . '&pass=' . urlencode($pass)
.. '&submit=' . urlencode($submit);
curl_setopt($ch, CURLOPT_URL, 'Login.asp');
curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $curlPost);
$data = curl_exec($ch);
echo $data . "<BR><BR>\n\n";
curl_setopt($ch, CURLOPT_URL, 'Page.asp');
curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$data = curl_exec($ch);
curl_close($ch);
echo($data);
Navigation:
[Reply to this message]
|