How does Ctrip api develop content information? I didn't find the corresponding interface on Ctrip and asked about the official group. I basically didn't take it seriously!
Reply to discussion (solution)
CURL used
If there is any content in the source code, you can capture it.
It is normal that the official group does not take proper measures. you collect others' things and increase the pressure on others' servers. Of course you won't be taken care.
');$pos2 = strpos($content, '');$content = substr($content, $pos1, $pos2-$pos1);// hrefpreg_match_all('/(.*?)<\/span>/i', $content, $matches);$price = $matches[1];$data = array();for($i=0,$len=count($href); $i<$len; $i++){ $data[] = array( 'href' => $href[$i], 'src' => $src[$i], 'title' => $title[$i], 'price' => $price[$i], );}print_r($data);?>
Array ([0] => Array ([href] => http://vacations.ctrip.com/tickets/p1833645.html [Src] => http://pkgpic.ctrip.com/images2/1/152/152_3391_g07660.jpg [Title] => [limited quantity hot sale! Parent-Child Pass (Father's Day 6.14-15)] Tickets to Changlong Water Park in Guangzhou (5 special privileges for purchasing tickets !) [Price] = & gt; 285) [1] = & gt; Array ([href] = & gt; http://vacations.ctrip.com/tickets/p1655820.html [Src] => http://pkgpic.ctrip.com/images2/1/152/152_1660_g07660-m.jpg [Title] => Guangzhou Tower sightseeing tickets (spot price) [price] => 135) [2] => Array ([href] => http://vacations.ctrip.com/tickets/p83829.html [Src] => http://pkgpic.ctrip.com/images2/1/152/152_3331_g07660-m.jpg [Title] => Guangzhou Lingnan Impression Park scenic spot tickets (spot price) [price] => 30) [3] => Array ([href] => http://vacations.ctrip.com/tickets/p1811853.html [Src] => http://pkgpic.ctrip.com/images2/1/27/27_523_g07660-m.jpg [Title] => [hot sale !] Tickets to Hengqin Changlong International Ocean Resort in Zhuhai, Guangdong province (Scenic spots) [price] => 100) [4] => Array ([href] => http://vacations.ctrip.com/tickets/p84788.html [Src] => http://pkgpic.ctrip.com/images2/1/152/152_919_s28632-m.jpg [Title] => aquarium ticket [price] => 120) [5] => Array ([href] => http://vacations.ctrip.com/tickets/p1659651.html [Src] => http://pkgpic.ctrip.com/images2/1/27/27_134_s31517-m.jpg [Title] => [EXCLUSIVE! Special day half-price hot sale (6.28-29)] Zhuhai Haiquan Bay ocean hot spring tickets (spot price) [price] => 90) [6] => Array ([href] => http://vacations.ctrip.com/tickets/p84522.html [Src] => http://pkgpic.ctrip.com/images2/1/207/207_697_s45214-m.jpg [Title] => tickets to Changlu Farm, Shunde, Guangdong province [price] => 35 ))
You can go to the ucenter documentation.
Thanks for your reply. Ctrip has an interface, but it has not been made public. it has already been done!