Use CURL to read website and load fields? website automation?
Posted 10 October 2006 - 03:19 PM
I have never done this type of programming (ie CURL/wget)
I need it to access the site, log me in and go to a certain page and extract the information and store it in my MySQL table.
Are there any examples on how to code something like this. Not the table work but the CURL/wget and filling in the fields.
Thanks for any advice.
Posted 10 October 2006 - 03:56 PM
example from: http://usphp.com/man...n.curl-exec.php
all curl options: http://usphp.com/curl_setopt
<?php // create a new curl resource $ch = curl_init(); // set URL and other appropriate options curl_setopt($ch, CURLOPT_URL, "http://www.example.com/"); //full URL of your query curl_setopt($ch, CURLOPT_HEADER, 0); //don't display or store the header information returned curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); //curl_exec() will returns the page instead of true or false curl_setopt($ch, CURLOPT_COOKIEJAR, "cookies.txt"); //store incoming cookies to this file curl_setopt($ch, CURLOPT_COOKIEFILE, "cookiex.txt"); //retrieve cookies asked for by the site from this file curl_setopt($ch, CURLOPT_POST, 1); //we're using the "POST" method curl_setopt($ch, CURLOPT_POSTFIELDS, "user=myusername&password=mypassword"); //post these fields // grab URL and pass it to the browser $var = curl_exec($ch); // close curl resource, and free up system resources curl_close($ch); echo $var; ?>
Posted 10 October 2006 - 06:23 PM
Posted 11 October 2006 - 12:47 AM
This is the code....
alt="Member Login" onclick="doSubmit('Login_loginbutton')"
Posted 11 October 2006 - 12:53 AM
Posted 11 October 2006 - 04:26 PM
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users