Help with a crawler

Discussion in 'PHP' started by t3od0r, Mar 14, 2010.

  1. #1
    Hello, i am trying to get the embed code from this page:
    http://tvshack.net/tv/How_I_Met_Your_Mother/season_5/episode_17/a:742478/
    Code (markup):
    the code is between <div id="player-showtime"></div> but is generated by javascript and i tried with curl but i can't get that code.
    can anyone give a hint?

    Thans,
     
    t3od0r, Mar 14, 2010 IP
  2. danx10

    danx10 Peon

    Messages:
    1,179
    Likes Received:
    44
    Best Answers:
    2
    Trophy Points:
    0
    #2
    <?php
    
    $file = file_get_contents("http://tvshack.net/tv/How_I_Met_Your_Mother/season_5/episode_17/a:742478/");
    
    preg_match("/<div id=\"player-showtime\">(.*)<\/div>/", $file, $matches);
    
    print_R($matches);
    
    ?>
    PHP:
    Untested.
     
    danx10, Mar 14, 2010 IP
  3. t3od0r

    t3od0r Well-Known Member

    Messages:
    334
    Likes Received:
    3
    Best Answers:
    3
    Trophy Points:
    155
    #3
    is not working, i tried this.

    If you continue to see this message, please make sure that Javascript is enabled and any Ad Blocking software you are using is disabled!
    Code (markup):
     
    t3od0r, Mar 14, 2010 IP