fetching google images through html dom parser
I want to fetch images from goolge/images again any query. I am using following code but h开发者_如何学Caving no result. count always return zero.
$html = new simple_html_dom(); $html=file_get_html('http://www.google.com.pk/images?q='.$_GET['q']); $find=$html->find('ul.rg_ul li'); echo(count($find));
First i want to get all li tags from ul.rg_ul. But it always return zero. what is wrong with it. i am totally stuck on this. I have even tried
$find=$html->find('a.rg_l img');but result is always zero
At last found solution by self learning and researching after receiving no response. Google doesn't support the method which i was using. Google provides its API to fetch the images. But I have done it by a mini google bot. Now any one who is facing problem can get advantage from here :P
精彩评论