php - How to get website content if its part is dynamically loaded -
1st of need inform im trying ceontent website adults if youre under 18 don't enter (i need purpose of using affiliate program) website url showup[dot]tv.
i need capture number of received coins displayed in 2 places on page of each girl (online of course). can check link show numbers on website:
below code able make (i have used girl natusia example girl have change curently online girl). it's working can pass 1st "confirmation of age" page sending cookie , can string need but... since number of coins dynamically loaded cant number... instead im getting "- / - żetonów (0%)" can me correct "parse?" code? (im begginer):
<?php function get_string_between($string, $start, $end){ $string = ' ' . $string; $ini = strpos($string, $start); if ($ini == 0) return ''; $ini += strlen($start); $len = strpos($string, $end, $ini) - $ini; return substr($string, $ini, $len); } $opts = array( 'http'=>array( 'method'=>"get", 'header'=>"accept-language: en\r\n" . "cookie: accept_rules=true\r\n" ) ); $context = stream_context_create($opts); $fullstring = file_get_contents('http://showup.tv/natusia', false, $context); $parsed = get_string_between($fullstring, '<span class="progress-text">', '</span>'); echo $parsed; ?>
Comments
Post a Comment