I'm trying to parse a table on a webpage to pull down some data I
need. The page is based off of information entered into a form. when
you submit the data from the form it displays a "Searching. .." page
then, refreshes and displays the table I want. I have code that grabs
data from the page using cURL but when I look at the data it contains
the "Searching. .." page and not the table that I want. below is the
code i have so far....Thanks in advance for any help.
<?php
$url="http://www.website.com ";
$post_data = array();
$post_data['postvar1'] = "val1";
$post_data['postvar2'] = "val2";
$o="";
foreach($post_d ata as $k=>$v)
{
$o.= "$k=".utf8_enco de($v)."&";
}
$post_data=subs tr($o,0,-1);
$ch= curl_init();
curl_setopt($ch , CURLOPT_POST,1) ;
curl_setopt($ch , CURLOPT_HEADER, 0);
curl_setopt($ch , CURLOPT_RETURNT RANSFER, 1);
curl_setopt($ch , CURLOPT_URL,$ur l);
curl_setopt($ch , CURLOPT_POSTFIE LDS, $post_data);
$result = curl_exec($ch);
curl_close($ch) ;
$result=explode ("\n",$resul t);
?>
need. The page is based off of information entered into a form. when
you submit the data from the form it displays a "Searching. .." page
then, refreshes and displays the table I want. I have code that grabs
data from the page using cURL but when I look at the data it contains
the "Searching. .." page and not the table that I want. below is the
code i have so far....Thanks in advance for any help.
<?php
$url="http://www.website.com ";
$post_data = array();
$post_data['postvar1'] = "val1";
$post_data['postvar2'] = "val2";
$o="";
foreach($post_d ata as $k=>$v)
{
$o.= "$k=".utf8_enco de($v)."&";
}
$post_data=subs tr($o,0,-1);
$ch= curl_init();
curl_setopt($ch , CURLOPT_POST,1) ;
curl_setopt($ch , CURLOPT_HEADER, 0);
curl_setopt($ch , CURLOPT_RETURNT RANSFER, 1);
curl_setopt($ch , CURLOPT_URL,$ur l);
curl_setopt($ch , CURLOPT_POSTFIE LDS, $post_data);
$result = curl_exec($ch);
curl_close($ch) ;
$result=explode ("\n",$resul t);
?>
Comment