간단한 질문이 있으니 답을 찾으셔야합니다. 사실 나는 ASIN 코드의 제품에 대한 정보를 얻기 위해 Amazon's API를 사용할 수 있지만,이 이미지의 경우에는 다른 형식, 하나의 큰 이미지, 중간 정도의 엄지 손가락 등을 얻을 수 있습니까?Amazon API는 제품에서 모든 이미지를 가져옵니다
제 경우에는 제품에서 모든 이미지를 가져올 수 있는지 알고 싶습니다. 스크래프를 사용하여 모든 이미지를 가져올 수 있다면 다른 형식으로 표시하지 말고,이 경우에는 API를 사용하고 싶습니다.
$gallery=htmlentities((string) $item->ImageSets->ImageSet->LargeImage->URL);
항목 구조 :
사실 내가 이것을 사용 더 깨끗하고 S와 CURL에서 많은 쿼리와 haven't 문제 scrapp를 사용하여
기능 API 코드 :
function getAmazonPrice($region, $asin)
{
global $precioamz;
global $amountamz;
global $imageamz;
global $galeriaamz;
$xml = aws_signed_request($region, array(
"Operation" => "ItemLookup",
"ItemId" => $asin,
"IncludeReviewsSummary" => False,
"ResponseGroup" => "Medium,OfferSummary",
));
$item = $xml->Items->Item;
$title = htmlentities((string) $item->ItemAttributes->Title);
$url = htmlentities((string) $item->DetailPageURL);
$image = htmlentities((string) $item->MediumImage->URL);
$price = htmlentities((string) $item->OfferSummary->LowestNewPrice->Amount);
$amount=htmlentities((string) $item->OfferSummary->LowestNewPrice->Amount);
$item->OfferSummary->LowestUsedPrice->Amount);
$code = htmlentities((string) $item->OfferSummary->LowestNewPrice->CurrencyCode);
$qty = htmlentities((string) $item->OfferSummary->TotalNew);
$gallery=htmlentities((string) $item->ImageSets->ImageSet->LargeImage->URL);
/// $gallery=Images,ItemAttributes,Variations,VariationImages
if ($qty !== "0")
{
$response = array(
"code" => $code,
"price" => number_format((float) ($price/100), 2, '.', ''),
"image" => $image,
"url" => $url,
"title" => $title,
"amount" => $amount,
"galeria" => $gallery
);
}
$precioamz=$response['price'];
$amountamz=$response['amount'];
$imageamz=$response['image'];
$galeriaamz=$response['galeria'];
//return $response;
}
function getPage($url)
{
$curl = curl_init($url);
curl_setopt($curl, CURLOPT_FAILONERROR, true);
curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
$html = curl_exec($curl);
curl_close($curl);
return $html;
}
만 한 이미지를 얻고 난이 제품에서 모든 이미지를 얻을 원하는 도움말에 대한 thank's, 내가 오해하지 않는 경우
@Jos는 내가 당신을 위해 일했는지 아닌지 알려주시겠습니까? –
아니요, 제 질문에서 제품의 모든 이미지에 대해 이야기합니다. 아마존에서 제품을 보러 가면 다양한 이미지를 볼 수 있습니다. API에서 다른 크기 또는 해상도의 이미지 만 가져올 수 있습니다. 여기까지 넣을 수 있지만 제품에는 갤러리가 있습니다. 이미지, API에서 나는 같은 이미지가 아닌 제품의 모든 이미지를 보여주고 싶습니다. 실제로 파서로드 DOM 제품을 사용하여 웹 사이트를로드하고이 이미지와 데이터베이스를 표시 할 때 모든 이미지를 표시 할 수 있지만 문제는 아마존의 것입니다. API는 하나의 이미지 만 보여 주며, 다른 이미지는 아마존의 API 만 사용하여 표시 할 수 있는지 모르겠다. – Jos