I am trying to parse some code out of a div with a dynamic id, for example: (where xxxx stands for random numbers).
Is there any way to scrape given div's elements by using regex to match all the possible id, for example post-1111, post-1213, etc..
Here's my code:
dd`
$target_html = $list_array[$i]->href;
$ftp_html = file_get_html($target_html);
$ftp_list = $ftp_html->find('div.main', 0);
$ftp_array = $ftp_list->find('div#post-4885 a[id="player"]');
for($j = 0; $j < sizeof($ftp_array); $j++){
print_r($ftp_array[$j]->rel.'<br>');
}
echo '<hr>';
Example HTML on a server:
<div class="main>
<div id="post-xxxx:>
elements...
</div></div>`