3
$ch = curl_init('site');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/6.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.7) Gecko/20050414 Firefox/1.0.3");
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_COOKIEJAR, 'x.txt');
curl_setopt($ch, CURLOPT_COOKIEFILE, 'x.txt');
$html = curl_exec($ch);
$dom = new DOMDocument();
@$dom->loadHTML($html);
$link = array();
foreach($dom->getElementsByTagName('a') as $link) {
# Mostrar todos os elemento que estiver dentro da tag href
$x = $link->getAttribute('href'); // exibi todos os conteudo dentro do href !
// pegar apenas o link completo
#https://www.site.com/checkout.asp?ref=fvFDGND2MYQ
///
echo $x;
poem this way I can get all the html links received from Curl
and for me to just take the https://www.site.com/checkout.asp?ref=fvFDGND2MYQ ? only that link ?
:)) Now yes I caught only the link I need thank you very much ...
– W3n