$ Chcurl_init (); $ timeout0; curl_setopt ($ ch, CURLOPT_CONNECTTIMEOUT, $ timeout); curl_setopt ($ ch, timeout, 1); curl_setopt ($ ch, CURLOPT_HTTPHEADER, array (& #39; User-Agent: Mozilla5.0 (iPhone; CPUiPhoneOS8_0likeMacOSX) Appl php mobile phone
$ch = curl_init();$timeout = 0;curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);curl_setopt($ch, CURLOPT_HTTPHEADER, array('User-Agent: Mozilla/5.0 (iPhone; CPU iPhone OS 8_0 like Mac OS X) AppleWebKit/600.1.3 (KHTML, like Gecko) Version/8.0 Mobile/12A4345d Safari/600.1.4')); $url = “http://search.shopping.yahoo.co.jp/search?p=%E9%9D%B4%E4%B8%8B&cid=&aq=-1&oq=&ei=UTF-8&first=1&tab_ex=commerce&sc_i=shp_pc_search_searchBox&mcr=2bfff23b09f55e9cac4a596fa6ab2f9f&ts=1439864569”; curl_setopt($ch, CURLOPT_URL, $url); $contents = curl_exec($ch); print_r($contents);
Theoretically, the printed $ contents should be equal to the page corresponding to the url, for example, 1-1:
-1
But in fact, the page corresponding to another url, such as 1-2:
-2
This occurs only when the Japanese yahoo is captured. it is normal to capture the Japanese Lotte page.
1) What is the cause of this?
2). how can I prevent page jumps and get pages correctly?