Witam, mam taki skrypt;
require_once 'simple_html_dom.php';
$url = 'https://www.pornhub.com/video/search?search=teen';
$userAgent = 'Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.6) Gecko/20100625 Firefox/3.6.6';
$ch = curl_init();
curl_setopt($ch, CURLOPT_USERAGENT, $userAgent);
curl_setopt($ch, CURLOPT_URL,$url);
curl_setopt($ch, CURLOPT_FAILONERROR, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_AUTOREFERER, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_TIMEOUT, 50);
$str= curl_exec($ch);
if (!$str)
{
echo "<br />cURL error number:" .curl_errno
($ch); echo "<br />cURL error:" . curl_error
($ch); }
$html = str_get_html($str);
foreach($html->find('div.phimage') as $titl) {
$title[] = $titl->find('a', 0)->innertext;
}
Chcę pobrać tytuł, jednak wywala mi:
Array
(
[0] =>
<div class="img videoPreviewBg">
i tak dalej i tak dalej.
Chciałbym pobrać tytuły wszystkich filmów.
Czy jest możliwosć aby w jednej tablicy mieć wszystko info czyli np:
Tytuł, Adres filmu, Obrazek?
jeżeli tak to jak?