Hello, I need help with file_get_contents('http://.../.../...')..
I have seen other ways of this used, but I don't see it used the way that I need it. I pretty much want to scrape information off of another site, this is totally legal for me with this company I am working with.
I want to use this or file(http://.../.../.../) or something that will be somewhat easy and somewhat technical at the same time being that I need to have this automated so I can grab results from the site and place to a text file then to a new database in this script....
I grabbed this off the net to use as an example. I like the way that this works but....
--------------------------------------------------------------------
----------------------------------------------------------------PHP Code:$lines = file('some_page.php');
foreach ($lines as $line_num => $line) {
echo "Line #<b>{$line_num}</b> : " . htmlspecialchars($line) . "<br />\n";
}
but,,,it obviously, reads out the lines from the grabbed html, not certain variables or words in the document(html) that I need.
Can I add a preg_replace function, or something of this nature, to extract only certain words or phrases that are in this html code. This is kinda like the <title> </title> tag grabbing, but with other phrases or words in the template.
thanks
steve



Bookmarks