ทำไม curl หน้า web ของ Amazon แล้วได้ผลลัพท์ไม่เหมือนกับหน้าจริง

เริ่มโดย s4721069, 20 มิถุนายน 2011, 14:32:42

หัวข้อก่อนหน้า - หัวข้อถัดไป

0 สมาชิก และ 1 ผู้มาเยือน กำลังดูหัวข้อนี้

s4721069

http://www.amazon.com/s/qid=1308553755/ref=sr_pg_3/186-3464008-0609661?ie=UTF8&keywords=shower%20handheld&bbn=468240&d=1&rh=i%3Aaps%2Ck%3Ashower%20handheld&page=3
ถ้าเข้า url ข้างบนจะเห็นว่ามีสินค้ามากกว่า 3 หน้า มีปุ่ม Next ไปหน้า 4 ได้

แต่ถ้า curl ดัง code ข้างล่างจะเห็นว่ามีสินค้าแค่ 3 หน้า ไม่มีปุ่ม Next
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'http://www.amazon.com/s/qid=1308553755/ref=sr_pg_3/186-3464008-0609661?ie=UTF8&keywords=shower%20handheld&bbn=468240&d=1&rh=i%3Aaps%2Ck%3Ashower%20handheld&page=3');
curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_FILETIME, true);
$data = curl_exec($ch);
curl_close($ch);
echo $data;


หรือเป็นเพราะว่า Amazon ป้องกันไว้
[direct=http://atkcovid19.lnwshop.com]ขายชุดตรวจ ATK แท้ 100% มี อย. ราคาถูก
[/direct]

ohmohm

ใช้ curl แล้ว ลองดูที่ source มีแบบนี้หรือเปล่า
<a title="Next page" id="pagnNextLink" class="pagnNext" href="/gp/search/ref=sr_pg_4?rh=i%3Aaps%2Ck%3Ashower+handheld&page=4&d=1&bbn=468240&keywords=shower+handheld&ie=UTF8&qid=1309093781">Next »</a>

s4721069

[direct=http://atkcovid19.lnwshop.com]ขายชุดตรวจ ATK แท้ 100% มี อย. ราคาถูก
[/direct]

s4721069

ได้แล้วครับ เพิ่ม
$useragent="Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.1) Gecko/20061204 Firefox/2.0.0.1";

curl_setopt($ch, CURLOPT_USERAGENT, $useragent);

[direct=http://atkcovid19.lnwshop.com]ขายชุดตรวจ ATK แท้ 100% มี อย. ราคาถูก
[/direct]