攜程api開發

來源:互聯網
上載者:User
如何擷取的內容資訊?在攜程沒找到對應介面,詢問官方群,基本不搭理!


回複討論(解決方案)

CURL用過沒

源碼裡如果有內容的話應該是可以抓取吧

官方群不搭理是正常的,你採集別人的東西,對別人伺服器增加壓力。當然不會搭理你。



/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] => 【限量熱賣!親子套票(父親節6.14-15)】廣州長隆水上樂園門票(購票享5大特權!)            [price] => 285        )    [1] => Array        (            [href] => http://vacations.ctrip.com/tickets/p1655820.html            [src] => http://pkgpic.ctrip.com/images2/1/152/152_1660_g07660-m.jpg            [title] => 廣州塔觀光門票(景區現付)            [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] => 廣州嶺南印象園景區門票(景區現付)            [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] => 【熱賣!】廣東珠海橫琴長隆國際海洋度假區門票(各景區)            [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] => 廣州海洋館門票            [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] => 【獨家!特權日半價熱賣(6.28-29日)】珠海海泉灣海洋溫泉門票(景區現付)            [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] => 廣東順德長鹿農莊門票            [price] => 35        ))

你可以去看下ucenter文檔

感謝大家的回複,攜程有介面,只是沒有公開,已經搞定!

  • 聯繫我們

    該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

    如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.