Jump to content

lewiskk

New Members
  • Posts

    1
  • Joined

  • Last visited

lewiskk's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Can anyone tell me how to fetch all data in specific DIV and inside it is specifec Tag " <p></p>" of given url I Tried this but changing tag names but i Failed please any php expert can me help me ? <?php function getdata($Url){ $str = file_get_contents($Url); if(strlen($str)>0){ preg_match("/\<title\>(.*)\<\/title\>/",$str,$data); return $data[1]; } } echo getdata("http://www.w3schools.com/"); ?> Example URL : www.productsite.com Product Web HTML Example : <div class="products"> <a href="productsite.com" class="title"><strong>Product 1</strong></a><br/> <p>http://www.productsi...1.aspx<br/></p> <br/> </div> <div class="products"> <a href="productsite.com" class="title"><strong>Product 2</strong></a><br/> <p>http://www.productsi...2.aspx<br/></p> <br/> </div> <div class="products"> <a href="productsite.com" class="title"><strong>Product 3</strong></a><br/> <p>http://www.productsi...3.aspx<br/></p> <br/> </div> <div class="products"> <a href="productsite.com" class="title"><strong>Product 4</strong></a><br/> <p>http://www.productsi...4.aspx<br/></p> <br/> </div> <div class="products"> <a href="productsite.com" class="title"><strong>Product 5</strong></a><br/> <p>http://www.productsi...5.aspx<br/></p> <br/> </div> <div class="products"> <a href="productsite.com" class="title"><strong>Product 6</strong></a><br/> <p>http://www.productsi...6.aspx<br/></p> <br/> </div> <div class="products"> <a href="productsite.com" class="title"><strong>Product 7</strong></a><br/> <p>http://www.productsi...7.aspx<br/></p> <br/> </div> and so on ... This Output i need : http://www.productsi...ducatpage1.aspx http://www.productsi...ducatpage2.aspx http://www.productsi...ducatpage3.aspx http://www.productsi...ducatpage4.aspx http://www.productsi...ducatpage5.aspx http://www.productsi...ducatpage6.aspx http://www.productsi...ducatpage7.aspx and so on ...
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.