get div around searched keyword (file_get_contents('url')

joelito

New Member
So im creating a webcrawler and everything works, only got 1 problem.With \[code\]file_get_contents($page_data["url"]);\[/code\] I get the content of a webpage. This webpage is scanned when one of my keywords excists on the webpage.\[code\]$find = $keywords; $str = file_get_contents($page_data["url"]);if(strpos($str, $find) == true)\[/code\]When i want to insert the data into mysql-database i only want the info inside the div the keyword is find in.I know i have to use DOM but i'm new into the domdocument scene.EXAMPLE: http://crawler.tmp.remote.nl/example.php
 
Back
Top