http://www.sufeinet.com/plugin.php?id=keke_group

苏飞论坛

 找回密码
 马上注册

QQ登录

只需一步,快速开始

分布式系统框架(V2.0) 轻松承载百亿数据,千万流量!讨论专区 - 源码下载 - 官方教程

HttpHelper爬虫框架(V2.7-含.netcore) HttpHelper官方出品,爬虫框架讨论区 - 源码下载 - 在线测试和代码生成

HttpHelper爬虫类(V2.0) 开源的爬虫类,支持多种模式和属性 源码 - 代码生成器 - 讨论区 - 教程- 例子

查看: 4079|回复: 6

[HttpHelper] 一个国外网站的采集问题

[复制链接]
发表于 2019-4-18 09:40:56 | 显示全部楼层 |阅读模式
https://www.mcxindia.com/market-data/market-watch

上面的网站需要采集列表里面显示的一些价格这样的数据!
需要post方式,但是抓包没看到有什么参数,不传参数获取不到内容

            HttpHelper http = new HttpHelper();
            HttpItem item = null;

            //参数类
            item = new HttpItem()
            {
                URL = "https://www.mcxindia.com/backpage.aspx/GetMarketWatch",//URL     必需项
                Encoding =null ,//编码格式(utf-8,gb2312,gbk)     可选项 默认类会自动识别
                Method = "Post",//URL     可选项 默认为Get
                Referer = "https://www.mcxindia.com/market-data/market-watch",
                ContentType = "application/json",//返回类型    可选项有默认值
                UserAgent = "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2900.0 Iron Safari/537.36",
                Postdata = ""

            };

            HttpResult result = http.GetHtml(item);


采集这块我还是新手!请大神指教这个数据怎么采集!


1. 开通SVIP会员,免费下载本站所有源码,不限次数据,不限时间
2. 加官方QQ群,加官方微信群获取更多资源和帮助
3. 找站长苏飞做网站、商城、CRM、小程序、App、爬虫相关、项目外包等点这里
发表于 2019-4-18 10:27:26 | 显示全部楼层
没有抓对包吧,post不应该是没有数据的。
发表于 2019-4-18 10:27:40 | 显示全部楼层
最少应该是带上Cookie的。
 楼主| 发表于 2019-4-18 10:40:10 | 显示全部楼层
Request URL:https://translate.googleapis.com ... 3.343330&mode=1
Request MethodOST
Status Code:200
Remote Address:203.208.41.37:443

access-control-allow-origin:*
alt-svc:quic=":443"; ma=2592000; v="46,44,43,39"
cache-control:private, max-age=600
content-disposition:attachment; filename="f.txt"
content-encoding:gzip
content-language:zh-CN
content-length:257
content-type:application/json; charset=UTF-8
date:Thu, 18 Apr 2019 02:30:45 GMT
expires:Thu, 18 Apr 2019 02:30:45 GMT
server:HTTP server (unknown)
status:200
x-content-type-options:nosniff
x-xss-protection:0
:authority:translate.googleapis.com
:methodOST
:path:/translate_a/t?anno=3&client=te_lib&format=html&v=1.0&key=AIzaSyDRSLSB5jh_yAvRzjykeUfyZGDxbSpXcZg&logld=vTE_20181015_01&sl=mr&tl=zh-CN&sp=nmt&tc=1&dom=1&sr=1&tk=240323.343330&mode=1
:scheme:https
accept:*/*
accept-encoding:gzip, deflate, br
accept-language:zh-CN,zh;q=0.8
alexatoolbar-alx_ns_ph:AlexaToolbar/alxg-3.3
content-length:571
content-type:application/x-www-form-urlencoded
dnt:1
origin:https://www.mcxindia.com
referer:https://www.mcxindia.com/mr/market-data/market-watch
user-agent:Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2900.0 Iron Safari/537.36

抓包抓到了
 楼主| 发表于 2019-4-18 10:41:12 | 显示全部楼层

Request URL 就带了很多参数 !这个 post 就需要传参数了吧?
 楼主| 发表于 2019-4-18 10:44:30 | 显示全部楼层
抓包里面没有cooks
发表于 2019-4-18 16:15:06 | 显示全部楼层
clalj520 发表于 2019-4-18 10:44
抓包里面没有cooks

cookie有啊带上,换个抓包软件试试,别用流量器自带的。
您需要登录后才可以回帖 登录 | 马上注册

本版积分规则

QQ|手机版|小黑屋|手机版|联系我们|关于我们|广告合作|苏飞论坛 ( 豫ICP备18043678号-2)

GMT+8, 2024-3-29 02:44

© 2014-2021

快速回复 返回顶部 返回列表