Php scraping

I am very new to programming and need a little help with getting data from a website and passing it into my PHP script.

The website is http://www.birthdatabase.com/.

I would like to plug in a name (First and Last) and retrieve the result. I know you can query the site by passing the name in the URL, but I am having problems scraping the results.

http://www.birthdatabase.com/cgi-bin/query.pl?textfield=FIRST&textfield2=LAST&age=&affid=

I am using the file_get_contents($URL) function to get the page but need help after that. Specifically, I would like to scrape only the results from a certain state if there are multiple results for that name.

Thanks for your help.

Just to add to the above post, I have since been told to use the simple_html_dom class from

http://simplehtmldom.sourceforge.net/

The output from http://www.birthdatabase.com/cgi-bin/query.pl?textfield=john&textfield2=smith&age=&affid=contains so many tables, that I can’t figure out how to isolate the one I need with the actual results and parse that into an array. Any help would be much appreciated.

Thanks,

Doug

Sponsor our Newsletter | Privacy Policy | Terms of Service