用抓包里面的数据进行协议握手的时候,就是返回不了数据!需要C语言!

https://us.ceair.com/en/booking-new.html?ZnJvbVZhbHVlPUVXUiUyQ0pGSyUyQ0xHQSUyQ1NXRiZ0b1ZhbHVlPVBWRyUyQ1NIQSZmcm9tTGFiZWw9JUU3JUJBJUJEJUU3JUJBJUE2JnRvTGFiZWw9JUU0JUI4JThBJUU2JUI1JUI3JnRyYXZlbFR5cGU9b25ld2F5JmRhdGUxPTE2NTg4NTEyMDAwMDAmYWR1bHQ9MSZjaGlsZD0wJmluZmFudD0wJmJ5UG9pbnRzPWZhbHNlJmlzUmVxdWVyeT1mYWxzZSZmbGlnaHRDbGFzcz0mZGVwQ2l0eUNvZGU9TllDJmFyckNpdHlDb2RlPVNIQQ==encode
这个网址在用抓包里面的数据进行协议握手的时候,就是返回不了数据!

你是需要这个站点的数据嘛.就是爬虫爬取数据这样的?

https://blog.csdn.net/Suzi_iT/article/details/79206066?spm=1005.2026.3001.5635&utm_medium=distribute.pc_relevant_ask_down.none-task-blog-2~default~OPENSEARCH~Rate-4.pc_feed_download_top3ask&depth_1-utm_source=distribute.pc_relevant_ask_down.none-task-blog-2~default~OPENSEARCH~Rate-4.pc_feed_download_top3ask

img

img

我简单看了一下,他的param参数用了简单的base64加密文本后面是一些专业的东西,get请求的内容会在url里面,只不过这个网站对内容进行了加密,如果你发送请求进行握手协议的时候没有按照对方的加密方式来的话,不返回数据(返回的不是你想要的)就纯属正常,还有登录这类网站一般都要cookie和refer,这些如果要登录账号的话就可以模拟登录拿到cookie,如果不需要登录的话你就可以发送一个假的请求来获取一个临时的cookie,爬虫技术不太行的话你可以用selenuim来爬取,大量请求的时候可能会被封IP并且速度比较慢,技术可以的话可以试一试自己写纯爬虫脚本来

您好,我是有问必答小助手,您的问题已经有小伙伴帮您解答,感谢您对有问必答的支持与关注!
PS:问答VIP年卡 【限时加赠:IT技术图书免费领】,了解详情>>> https://vip.csdn.net/askvip?utm_source=1146287632

这个是返回不了数据的,因为都是通过reactjs框架获取的数据,通过抓包不能直接得到的。至于你说的c并不是问题,用什么语言都是无法通过抓包来直接实现的。需要解析js运行得到数据的。有帮助请采纳谢谢!

使用 Clang libcurl 是获取不到这类页面的内容的,通过 ChromeDriver 可以实现。

建议使用python,可以参考该文章
https://blog.csdn.net/javaldk/article/details/122655815

那说明协议握手有问题呗,好好检查一下

是不是有些浏览器的特殊属性没有携带进去(比如cookie、header之类、浏览器标识)?还得详细检查

cookies,proxies,header这些东西没加?

这个js加载还有点问题,即使解析js还存在延迟的问题,因此还需要解决异步加载js的问题才可能正常截取。

    <div class="supermodal-wrapper"><div class="supermodal-modal col-xs-10 col-sm-6 col-md-5 col-lg-4 "><div class="supermodal-header"><a title="Close" class="supermodal-header-close" href="#"><span class="supermodal-header-close-symbol">×</span><span class="sr-only">Close</span></a><span title="title" class="supermodal-header-icon"></span><span class="supermodal-header-title">title</span></div><div tabindex="0" class="supermodal-content"><div><p></p></div></div></div></div></div><!-- react-text: 932 --><!-- /react-text --><ul class="flightDetails"><section class="cabin-choose-container"><div class="row cabin-header flex"><div class="flex-5"><div class="flex"><div class="plane-no-container flex al-center "><span class="plane-no"><!-- react-text: 940 -->MU<!-- /react-text --><!-- react-text: 941 -->588<!-- /react-text --></span><img width="14" src="/public/system/assets/images/airlineIcons/airline-code-MU.png"></div></div><div class="row ma-top-8 header-info-container"><span class="title-crossday"><!-- react-text: 945 -->+1<!-- /react-text --><!-- react-text: 946 --> <!-- /react-text --><!-- react-text: 947 -->Days<!-- /react-text --></span><div class="col-sm-2 flex-col"><span class="title-time">16:25</span><span class="title-airport"><!-- react-text: 951 -->JFK<!-- /react-text --><!-- react-text: 952 --> <!-- /react-text --><!-- react-text: 953 -->1<!-- /react-text --></span></div><div class="col-sm-8 flex-col al-center"><span class="title-arive">NONSTOP</span><div class="route-container flex al-center"><span class="icon-circle"></span><div class="route"></div><span class="icon-circle"></span><img class="icon-plane" src="/public/system/assets/images/flight/icon-normal-plane.svg"></div><span class="title-duration">15h</span></div><div class="col-sm-2 flex-col"><span class="title-time">19:25</span><span class="title-airport"><!-- react-text: 965 -->PVG<!-- /react-text --><!-- react-text: 966 --> <!-- /react-text --><!-- react-text: 967 -->T2<!-- /react-text --></span></div></div></div><div class="flex-1 border-left service-container flex-col"><div class="popup-container is-new "><div tabindex="0" class="son-container"><div class="flex al-center plane-info-container"><img alt="Fleets" src="/public/system/assets/images/flight/icon-plane.svg"><span class="title-plane-type" aria-hidden="true">Fleets</span></div><div class="pop-container"><div class="plane-type-container flex-col"><div class="tab-container flex ju-center"><div tabindex="0" class="type-container checked"><!-- react-text: 978 -->MU<!-- /react-text --><!-- react-text: 979 -->588<!-- /react-text --></div></div><div class="info-container flex"><span class="title-depart-arrive"><!-- react-text: 982 -->New York<!-- /react-text --><!-- react-text: 983 --><!-- /react-text --><!-- react-text: 984 -->Shanghai<!-- /react-text --><!-- react-text: 985 --> <!-- /react-text --><span class="title-flight-no"><!-- react-text: 987 -->MU<!-- /react-text --><!-- react-text: 988 -->588<!-- /react-text --></span></span><img width="14" src="/public/system/assets/images/airlineIcons/airline-code-MU.png"></div><span class="title-plane"><!-- react-text: 991 -->Fleets<!-- /react-text --><!-- react-text: 992 -->:<!-- /react-text --><!-- react-text: 993 --> <!-- /react-text --><!-- react-text: 994 -->Boeing777<!-- /react-text --></span><div class="flex-col"><img width="540" height="115" class="img-plane" src="/public/system/assets/images/flight/773.png"><div class="flex plane-tip-container"><span>The picture is for reference only, based on the actual model.</span></div></div></div></div></div></div><div class="bottom-container flex"><div class="flex service-container"><div class="popup-container is-new "><div tabindex="0" class="son-container"><img class="icon-service" alt="In order to ensure your travel is smooth, please make sure that your passport, visa and other documents meet the entry and exit requirements of the place of departure, transit and destination countries. Please consult the Exit and Entry Administration for details." src="/public/system/assets/images/flight/icon-visa.svg"><div class="pop-container"><div class="des-container">In order to ensure your travel is smooth, please make sure that your passport, visa and other documents meet the entry and exit requirements of the place of departure, transit and destination countries. Please consult the Exit and Entry Administration for details.</div></div></div></div><div class="dinner"></div><div class="popup-container is-new "><div tabindex="0" class="son-container"><img class="icon-service" alt="This flight provides on-board WI-FI service, and China Eastern Airlines members can make an appointment to apply for online qualification after purchasing tickets." src="/public/system/assets/images/flight/icon-plane-wifi.svg"><div class="pop-container"><div class="des-container">This flight provides on-board WI-FI service, and China Eastern Airlines members can make an appointment to apply for online qualification after purchasing tickets.</div></div></div></div></div><div class="popup-container is-new "><div tabindex="0" class="son-container"><div class="flex al-center"><span class="title-plane-service">Service</span></div><div class="pop-container"><div class="service-list-container flex-col"><div class="tab-container flex ju-center"><div tabindex="0" class="type-container checked"><!-- react-text: 1020 -->MU<!-- /react-text --><!-- react-text: 1021 -->588<!-- /react-text --></div></div>

C语言也完全可以实现啊,不难,你可以把你的需求再说清楚一点吗“这个网址在用抓包里面的数据进行协议握手的时候,就是返回不了数据!” ,你先要什么样格式的数据,都可帮你实现

使用 Clang libcurl 是获取不到这类页面的内容的,通过 ChromeDriver 可以实现。

建议使用python,可以参考该文章
https://blog.csdn.net/javaldk/article/details/122655815

未太懂 返回不了数据是指??? 不过我不会C语言,围观学习其余开发大神。

img



网站必须带上cookies才能返回数据。
HMF_CI=ef4516efce6bc4f0eb458e4fcbd7c962295613885474ebd75ff27eb865fce8fb32

img



如果直接访问,http头会设置Set-Cookie,重新加载。

建议补充一下内容,比如你是通过什么方式,用了什么代码,最终返回不了数据出的是什么日志,是报错信息还是什么也没有等

问题最好描述详细点,不知道是想问抓包的问题?还是用C语言爬数据?

如果你用台式机想获得代码,可以进入这个航天飞行网站,点f12就可以了。如果你的是笔记本电脑,可以点shift+f2