Help in a code only experts know this

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Help in a code only experts know this

    good morning experts i need your help i want to create a grraber of a site so i want to make my grraber coding like this
    1.
    in page the all files in <div class="file">file info.....</div> this tag so after every file
    so i want to pick all <div class="file"> tag and set according to my css so any one please help me to post a code to create its graaber

    in hindi
    ek page hai jis me page info and img and download link hai <div class="file" name ke tag main but uska setting mujhe pasand nai sirf mujhe esa code do tan joo main agar page main <div class="file"> nam ke sare tags ko pick kar ke apne according kar sakkkun

    #2
    isnt it easier just to change the css ?
    Code:
    .file {
    height = 90px; 
    }
    if answer is no just do a simple string replacement on the <div class="file">

    Comment


      #3
      Try this :D
      PHP Code:
      $match preg_match('/<div class="file">(.*)<\/div>/i'$file$matches);
      if(
      $match)
      {
      print_r($matches);

      Added after 3 minutes:

      lol,just saw the title of the thread, "only experts", sorry I'm noob
      Last edited by softwarefreak; 28.02.12, 04:11.
      I need some facebook likes, can you please help me
      http://facebook.com/softwarefreakin
      I noticed social media is really powerful
      Well DONE is better than well SAID

      Comment


        #4
        Not working bro i explain it
        HTML Code:
        <div class="file">
        <img src="prev.php?id=22651" alt="thumb" /><br /><a href="Download.php?id=22651">video 651</a> 8.38 MB
        </div>
        <div class="file">
        <img src="prev.php?id=22651" alt="thumb" /><br /><a href="Download.php?id=22651">video 651</a> 8.38 MB
        </div>
        <div class="file">
        <img src="prev.php?id=22651" alt="thumb" /><br /><a href="Download.php?id=22651">video 651</a> 8.38 MB
        </div>
        this type 5 files in a page so i want that no any another line is preview i want that i paste code
        <img src="$img"><br>$name<br><a href="$link">Download now!!</a>
        so i paste this code just one time and its graab all the files which is in the page under <div class=file> tag please help me

        Comment


          #5
          hi, try this
          PHP Code:
          <?php
          $file 
          '<div class="file">
          <img src="prev.php?id=22651" alt="thumb" /><br /><a href="Download.php?id=22651">video 651</a> 8.38 MB
          </div>
          <div class="file">
          <img src="prev.php?id=22651" alt="thumb" /><br /><a href="Download.php?id=22651">video 651</a> 8.38 MB
          </div>
          <div class="file">
          <img src="prev.php?id=22651" alt="thumb" /><br /><a href="Download.php?id=22651">video 651</a> 8.38 MB
          </div>'
          ;
          $chunk explode('<div class="file">'$file);
          //print_r($chunk);
          $count count($chunk);
          for (
          $i=1$i $count$i++) 
          {
              
          $match_name preg_match('/">(.*)<\/a>/i'$chunk[$i], $w);
              
          $match_thumb preg_match('/<img src="(.*)" alt="/i'$chunk[$i], $x);
              
          $match_link preg_match('/<a href="(.*)">/i'$chunk[$i], $y);
          $match_size preg_match('/<\/a>(.*\n)<\/div>/i'$chunk[$i], $z);


          echo 
          "<div class='my_css'>Filename:$w[1]<br />
          filesize:"
          .trim($z[1])."<br />
          Download link: 
          $y[1]<br />
          preview: 
          $x[1]</div>";
          }
          ?>
          Last edited by softwarefreak; 28.02.12, 18:24.
          I need some facebook likes, can you please help me
          http://facebook.com/softwarefreakin
          I noticed social media is really powerful
          Well DONE is better than well SAID

          Comment

          Working...
          X