Super simple question
Moderator: General Moderators
- superdezign
- DevNet Master
- Posts: 4135
- Joined: Sat Jan 20, 2007 11:06 pm
Actually, no it wont. Try it.
The '?' modifier stops it from being greedy and causes it to stop at the first instance of '</div>'. The only way for it to fail would be if there were divs nested within this one, in which case he would be after tokenization or some sort of parser. explode() is simply not practical.
The '?' modifier stops it from being greedy and causes it to stop at the first instance of '</div>'. The only way for it to fail would be if there were divs nested within this one, in which case he would be after tokenization or some sort of parser. explode() is simply not practical.
- superdezign
- DevNet Master
- Posts: 4135
- Joined: Sat Jan 20, 2007 11:06 pm
I'm working on a widget that extracts search results from sekko.
Here is the link to a sample page:
http://www.sekko.nl/?query=hani&page=1
Here is the link to a sample page:
http://www.sekko.nl/?query=hani&page=1
- superdezign
- DevNet Master
- Posts: 4135
- Joined: Sat Jan 20, 2007 11:06 pm
- superdezign
- DevNet Master
- Posts: 4135
- Joined: Sat Jan 20, 2007 11:06 pm
superdezign wrote:I don't know of any search engines that allow you to do that. You're basically *stealing* traffic and bandwidth from them.
What part of that do you want? What HTML?
It's not stealing, I've put their logo on top!
I just want the <div id="serps"></div> part, but only with the
link titles, descriptions and link.
I've put it on the previous page.
Code: Select all
preg_match_all('#<h4><a href="([^"]*)">(.*)</a></h4>#', $data, $title_links);
preg_match_all('#<p class="result">([^<]*)<br#',$data,$description);
preg_match_all('#<a class="url" href="([^"]*)">([^<]*)</a>#', $data, $footer_links);
print_r($title_links);
print_r($description);
print_r($footer_links);