开发者

Gathering a certain image from a website using a keyword (Dailybooth)

I'm working on this project at the moment and I need to gather the main image from a url that is given from DailyBooth. I've made a simple function that gathers info from inside 2 parameters from a given website. However, I would prefer to search for a url with a certain keyword (I.E image urls with word la开发者_Python百科rge in (which is only one on the given page)).


Give a look at PHP Simple DOM Parser

After grabbing the page in question, search for the #main_picture_container, and the image within;

foreach($html->find('div[id=main_picture_container]') as $maindiv)
{
       foreach($maindiv->find('img') as $img)
       {
             // do something...
       }
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜