
Zitat von
1stAid
data-old-hires="https://images-na.ssl-images-amazon.com/images/I/61sJVMWE%2BKL._SL1320_.jpg"
Du hast viel regex für etwas Bild;
als flag setze sigel-line
(?<=data-old-hires=\")(.*?)(?=\")
https://regex101.com/r/UJo9aJ/1
trifft.
Wenn du ein anderes format brauchst kannst du dir den link "bauen" da die immer gleich aufgebaut werden z.B.
https://images-na.ssl-images-amazon...._AC_US480_.jpg
für ein pic mit 480 pixeln.
In meinem Amazon(pic)crawler mache ich das seit Jahren ähnlich....
Danke, das hat wunderbar geholfen 
PHP-Code:
function get_data($url)
{
/* do some curl magic */
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 3);
$data = curl_exec($ch);
curl_close($ch);
return $data;
}
function get_match($regex, $content, $pos = 1)
{
/* do your job */
preg_match($regex, $content, $matches);
/* return our result */
return $matches[intval($pos)];
}
function amazonCrawler($url)
{
/* grab some data */
$amazon_content = get_data($url);
$amazon['price'] = @get_match('!<span id="priceblock_ourprice" class="a-size-medium a-color-price">(.+)</span>!iUm', $amazon_content);
preg_match_all('/(?<=data-old-hires=\")(.*?)(?<=\")/s', $amazon_content, $amazon['image']);
$array = array(
$amazon['price'],
$amazon['image'][0][1]
);
return ($array);
}
list($amazon['price'], $amazon['image'][0][1]) = amazonCrawler('https://www.amazon.de/MSI-GE72-6QD161-Notebook-6700HQ-Skylake/dp/B015CJQAFM/ref=lp_4368994031_1_1?s=computers&ie=UTF8&qid=1480761465&sr=1-1');
echo "111111<br /><br />";
echo "Preis: ".$amazon['price']."<br />";
echo "Image: ".str_replace('"', '', $amazon['image'][0][1])."<br />";