Re: parsing website with a "searching...." page



Aaron wrote:

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_data as $k=>$v)
{
$o.= "$k=".utf8_encode($v)."&";
}

$post_data=substr($o,0,-1);


$ch= curl_init();
curl_setopt($ch, CURLOPT_POST,1);
curl_setopt($ch, CURLOPT_HEADER,0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_URL,$url);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data);
$result = curl_exec($ch);
curl_close($ch);
$result=explode("\n",$result);

?>

Hi,

The page is probably using JavaScript to give that effect.
Inspect the content of $result to see if this is the case.
Look for divs that are not visible and made visible when the page loads (end
of script, or an onLoad event).
The data you want might very well be inside the $result.

If not, give more information WHAT the $result contained.

Regards,
Erwin Moller
.



Relevant Pages

  • Re: How to capture window.onload event in an IFRAME
    ... facing: I have got an HTML page that contains an IFRAME; 'myframe' loads another HTML page: 'secondpage.html'. ... I would stress that the onload control should be present on mainpage.html and it should be made only via JS code ...
    (microsoft.public.scripting.jscript)
  • Re: run of alsa-info-sh suceeded.
    ... On Friday 15 February 2008 13:34, Aaron Konstam wrote: ... The output from running the script on F8 is very incomplete. ... works with ISA cards as it does with PCI cards, ... The question is, should the script work as well with ISA cards, as it does ...
    (Fedora)
  • Re: error messages in Windows XP Internet Explorer
    ... > Aaron with Problems..... ... Disable script debugging ... Display a notification about every script error ... >>> install over windows 98, and I keep getting error messages ...
    (microsoft.public.windowsxp.general)
  • Re: Create package in place of script
    ... > Start a new package and include the script into Execute SQL task. ... I could drop the script into an execute sql task, ... Aaron ...
    (microsoft.public.sqlserver.dts)
  • Re: Website Monitoring Script
    ... If you can script in perl you can use the LWP module to pull the info and then ... can rcmd or telnet to the remote server and do the reset. ... Aaron wrote: ... If the download fails run iisreset ...
    (microsoft.public.dotnet.general)