ExcelHome技术论坛

 找回密码
 免费注册

QQ登录

只需一步,快速开始

快捷登录

搜索
EH技术汇-专业的职场技能充电站 妙哉!函数段子手趣味讲函数 Excel服务器-会Excel,做管理系统 效率神器,一键搞定繁琐工作
HR薪酬管理数字化实战 Excel 2021函数公式学习大典 Excel数据透视表实战秘技 打造核心竞争力的职场宝典
让更多数据处理,一键完成 数据工作者的案头书 免费直播课集锦 ExcelHome出品 - VBA代码宝免费下载
用ChatGPT与VBA一键搞定Excel WPS表格从入门到精通 Excel VBA经典代码实践指南
楼主: wcymiss

[原创] 不懂html也来学网抓(xmlhttp/winhttp+fiddler)

    [复制链接]

TA的精华主题

TA的得分主题

发表于 2016-8-18 14:21 | 显示全部楼层
本帖已被收录到知识树中,索引项:网页交互
网抓的时候ResponseText出现下面的错误,是什么原因?(设置Cookie就会出现这样的错误)
<!-- 页面不存在 -->
<html><head>
<title>页面不存在</title>
<link href="/vcss/zh.css" type="text/css" rel="stylesheet">
</head>

<body>

<h3>找不到对象或访问链接中包括非法字符</h3><!-- 文件未找到 -->
<p align="left" class="STYLE1">请把此问题反馈给系统管理员,谢谢!</p><!-- 请把此问题反馈给系统管理员,谢谢! -->
  
<p align="center" class="STYLE1 STYLE1">&nbsp;</p>

</body></html>

TA的精华主题

TA的得分主题

发表于 2016-8-21 15:52 | 显示全部楼层
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用  · 内置多项VBA编程加强工具       ★ 免费下载 ★      ★使用手册
花了周末的两天终于看完了教程,终于解决了困惑自己已久的问题,道一声谢。

TA的精华主题

TA的得分主题

发表于 2016-8-24 09:55 | 显示全部楼层
ghostjiao 发表于 2014-10-21 11:40
哇哇哇,吴女神,女神出现了,赶紧收藏了

她叫吴啥名字?

TA的精华主题

TA的得分主题

发表于 2016-8-25 16:24 | 显示全部楼层
wcymiss 发表于 2014-10-21 11:33
个人偏爱fiddler的原因:(唠叨话,可略过)

1、fiddler不需要寄生在浏览器中,且可抓到多个浏览器的包 ...

大师你好,抓取数据,可以把EXCEL数据写入到网页吗,用什么对象的方法属性

TA的精华主题

TA的得分主题

发表于 2016-8-25 16:25 | 显示全部楼层
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件       ★免费下载 ★       ★ 使用帮助
wcymiss 发表于 2014-10-21 11:33
个人偏爱fiddler的原因:(唠叨话,可略过)

1、fiddler不需要寄生在浏览器中,且可抓到多个浏览器的包 ...

大师你好,抓取数据,可以把EXCEL数据写入到网页吗,用什么对象的方法属性

TA的精华主题

TA的得分主题

发表于 2016-8-25 17:29 | 显示全部楼层

TA的精华主题

TA的得分主题

发表于 2016-8-26 14:36 | 显示全部楼层
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用  · 内置多项VBA编程加强工具       ★ 免费下载 ★      ★使用手册
请教: http://outlook.com  如何用winhttp或xmlhttp登录?试过用fiddler抓取登录的数据(如下,改掉了真实的用户名和密码部分),用程序登录不了。

POST https://login.live.com/ppsecure/post.srf?wa=wsignin1.0&ct=1471518785&rver=6.6.6556.0&wp=MBI_SSL&wreply=https:%2F%2Foutlook.live.com%2Fowa%2F&id=292841&CBCXT=out&bk=1471518817&uaid=fa286d19888d49cdb3ac3cca007d4bf7&pid=0 HTTP/1.1
Accept: text/html, application/xhtml+xml, */*
Referer: https://login.live.com/ppsecure/post.srf?wa=wsignin1.0&ct=1471518785&rver=6.6.6556.0&wp=MBI_SSL&wreply=https:%2F%2Foutlook.live.com%2Fowa%2F&id=292841&CBCXT=out&bk=1471518787&uaid=fa286d19888d49cdb3ac3cca007d4bf7&pid=0
Accept-Language: zh-CN
User-Agent: Mozilla/5.0 (Windows NT 6.1; Trident/7.0; rv:11.0) like Gecko
Content-Type: application/x-www-form-urlencoded
Accept-Encoding: gzip, deflate
Host: login.live.com
Content-Length: 1271
DNT: 1
Connection: Keep-Alive
Cache-Control: no-cache
Cookie: CkTst=G1471518815999; wlidperf=latency=278&throughput=&FR=L&ST=1471518842467; mkt=zh-CN; MUID=1901147EA7476C4A1A61125FA6446C94; MH=MSFT; wlp=A|78Sc-t:h*jCnBDg.Color_Blue:a*LfkJDg._; wla42=; ANON=A=092A95CA359A88FBA6F50C8FFFFFFFFF&E=12b9&W=1; NAP=V=1.9&E=125f&C=YtYoeDsaWHjYuAijeoDn-MjRYWV60oWDRkPqWToSPFDDzmPs87QZmg&W=1; E=P:rjfwgFjH04g=:8FcGJbOMNPyQH0ar+wK2KUWoMULR6Ub4NGBcAeBTs9w=:F; xid=08a1d584-ada6-4fff-9354-b5e7050d6df9&&SNT151-W88&274; xidseq=5; wlxS=wpc=1; HIC=8aa9428cac8ef490|0|3|snt151|1293|snt151; wls=A|78Sc-t:h*m:a*n; LDH=9; BP=l=WC.Hotmail&FR=&ST=&p=0; LN=6ymZN1471518724584%267e31%2611; SDIDC=CXREbn9Ct!9BnNis36JUzPqH5kDk1WEgGekiKTb2j*TQnpitJyXL8bUJDR1K*QJ5W!EgSd53BPpUAUyNnISJseNsSOyLTH4m7y2PrImcUawGDKEnj7lnbLWjaRaF1i95EOvN0!dEo*7s0*HUfQ9QmIk$; MSPPre=blzhu@outlook.com|8aa9428cac8ef490||; MSPCID=8aa9428cac8ef490; WLOpt=credtype=1&act=[1]; MSPSoftVis=@:@; MSPRequ=lt=1471518787&co=1&id=292841; MSPBack=0; idsbho=7.250.4232.0$7.250.4232.0$11.0.9600.17909$6.1.1.0.7601(Service Pack 1); IgnoreCAW=1; uaid=fa286d19888d49cdb3ac3cca007d4bf7; MSPOK=$uuid-73fb351f-0dc5-48fd-b99b-c3a470743b1a$uuid-70510438-dda0-4fa5-af92-29c66be95fb2$uuid-99b4628c-6d08-499c-b737-a55339d9c191; CkTst=G1471518786270

loginfmt=vbatest@outlook.com&login=vbatest@outlook.com&passwd=yourpassword&KMSI=on&type=11&PPFT=DZG90QHo6H3iktUZJx17imJGJZ*TVf4%21F*XD6NIk5dxEyxI2SOI3i7k%21JR3Q4*2lGfeSJQAzYrRMvAqAbJxqUUa8O3me7N88pGkc%21kL%21ht3WZI%21O0bz61onW*DlEk3Y1xy8wX8VtjiQgo16Dh8WSlyJ9USS9j9Xr2ZqoYQb4S1rjaVEKIOtcXDtc1d4NVedq9KeK*HwIN2*2%21R1S1X816YNtLcAKCd%21F3%21Kuok9Ikxjw&PPSX=Passport&NewUser=1&LoginOptions=1&FoundMSAs=&fspost=0&i2=1&i16=%7B%22navigationStart%22%3A1471518813516%2C%22unloadEventStart%22%3A1471518815800%2C%22unloadEventEnd%22%3A1471518815800%2C%22redirectStart%22%3A0%2C%22redirectEnd%22%3A0%2C%22fetchStart%22%3A1471518813518%2C%22domainLookupStart%22%3A1471518813518%2C%22domainLookupEnd%22%3A1471518813518%2C%22connectStart%22%3A1471518813518%2C%22connectEnd%22%3A1471518813518%2C%22requestStart%22%3A1471518814754%2C%22responseStart%22%3A1471518815775%2C%22responseEnd%22%3A1471518815778%2C%22domLoading%22%3A1471518815775%2C%22domInteractive%22%3A1471518815996%2C%22domContentLoadedEventStart%22%3A1471518815996%2C%22domContentLoadedEventEnd%22%3A1471518815996%2C%22domComplete%22%3A1471518815998%2C%22loadEventStart%22%3A1471518815999%2C%22loadEventEnd%22%3A0%2C%22msFirstPaint%22%3A0%7D&i17=0&i18=__DefaultLogin_Strings%7C1%2C__DefaultLogin_Core%7C1%2C&i19=26189&i21=0&i13=1

TA的精华主题

TA的得分主题

发表于 2016-8-28 23:06 | 显示全部楼层
登录用POST已经搞定,又被后边的一步难住了,想用post新建一个日程事项,fiddler看上去都抓到数据了,post就是不行,返回:

Cache-Control: private
Connection: close
Date: Sun, 28 Aug 2016 15:03:31 GMT
Content-Type: text/html; charset=utf-8
P3P: CP="BUS CUR CONo FIN IVDo ONL OUR PHY SAMo TELo"
Server: Microsoft-IIS/7.5
X-AspNet-Version: 4.0.30319
xxn: B5


<html>
    <head>
        <title>Runtime Error</title>
        <style>
         body {font-family:"Verdana";font-weight:normal;font-size: .7em;color:black;}
         p {font-family:"Verdana";font-weight:normal;color:black;margin-top: -5px}
         b {font-family:"Verdana";font-weight:bold;color:black;margin-top: -5px}
         H1 { font-family:"Verdana";font-weight:normal;font-size:18pt;color:red }
         H2 { font-family:"Verdana";font-weight:normal;font-size:14pt;color:maroon }
         pre {font-family:"Lucida Console";font-size: .9em}
         .marker {font-weight: bold; color: black;text-decoration: none;}
         .version {color: gray;}
         .error {margin-bottom: 10px;}
         .expandable { text-decoration:underline; font-weight:bold; color:navy; cursor:hand; }
        </style>
    </head>

    <body bgcolor="white">

            <span><H1>Server Error in '/' Application.<hr width=100% size=1 color=silver></H1>

            <h2> <i>Runtime Error</i> </h2></span>

            <font face="Arial, Helvetica, Geneva, SunSans-Regular, sans-serif ">

            <b> Description: </b>An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine.
            <br><br>

            <b>Details:</b> To enable the details of this specific error message to be viewable on remote machines, please create a &lt;customErrors&gt; tag within a &quot;web.config&quot; configuration file located in the root directory of the current web application. This &lt;customErrors&gt; tag should then have its &quot;mode&quot; attribute set to &quot;Off&quot;.<br><br>

            <table width=100% bgcolor="#ffffcc">
               <tr>
                  <td>
                      <code><pre>

&lt;!-- Web.Config Configuration File --&gt;

&lt;configuration&gt;
    &lt;system.web&gt;
        &lt;customErrors mode=&quot;Off&quot;/&gt;
    &lt;/system.web&gt;
&lt;/configuration&gt;</pre></code>

                  </td>
               </tr>
            </table>

            <br>

            <b>Notes:</b> The current error page you are seeing can be replaced by a custom error page by modifying the &quot;defaultRedirect&quot; attribute of the application&#39;s &lt;customErrors&gt; configuration tag to point to a custom error page URL.<br><br>

            <table width=100% bgcolor="#ffffcc">
               <tr>
                  <td>
                      <code><pre>

&lt;!-- Web.Config Configuration File --&gt;

&lt;configuration&gt;
    &lt;system.web&gt;
        &lt;customErrors mode=&quot;RemoteOnly&quot; defaultRedirect=&quot;mycustompage.htm&quot;/&gt;
    &lt;/system.web&gt;
&lt;/configuration&gt;</pre></code>

                  </td>
               </tr>
            </table>

            <br>

    </body>
</html>

我估计是post data编码有问题。不管用哪种编码,跟fiddler request里面raw显示的不一样。postdata包括特殊字符, ='"{()}空格, 也包括中文。有高手能指点一下吗?谢谢

TA的精华主题

TA的得分主题

发表于 2016-9-3 23:42 | 显示全部楼层
VBA万岁 发表于 2014-10-23 12:42
将老师抓取到的数据导入Excel表如附件:

翻页的关键是什么

TA的精华主题

TA的得分主题

发表于 2016-9-7 13:09 | 显示全部楼层
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用  · 内置多项VBA编程加强工具       ★ 免费下载 ★      ★使用手册
先给楼主点个赞,继续学习
您需要登录后才可以回帖 登录 | 免费注册

本版积分规则

手机版|关于我们|联系我们|ExcelHome

GMT+8, 2024-10-6 23:18 , Processed in 0.040592 second(s), 5 queries , Gzip On, MemCache On.

Powered by Discuz! X3.4

© 1999-2023 Wooffice Inc.

沪公网安备 31011702000001号 沪ICP备11019229号-2

本论坛言论纯属发表者个人意见,任何违反国家相关法律的言论,本站将协助国家相关部门追究发言者责任!     本站特聘法律顾问:李志群律师

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