Re: Pulling Data From a Page
| From: | Richard Lynch | Date: | Mon, 06 Nov 2006 20:57:59 +0000 |
| Subject: | Re: Pulling Data From a Page | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-244271@lists.php.net to get a copy of this message | ||
On Mon, November 6, 2006 1:59 pm, Phillip Baker wrote:
> Grab the HTML file.
You have correctly identified it as a FILE.
Try looking on the php.net site for FILE functions.
http://php.net/file_get_contents
echo htmlentities(file_get_contents('http://php.net/'));
> Parse it for the values I am looking for.
http://php.net/pcre
http://php.net/preg_match_all
> And then plug it into variables for use on my site.
If you need to login to get to the page you want, you'll probably want
to use curl:
http://php.net/curl
Also check if the data you want is provided by RSS feed instead of
web-scraping.
And the previous post regarding permission is definitely Right.
--
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some starving artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?