请问这个页面如何用IDHTTP获取内容? 请问如何用IDHTTP获取这个页面: http://hb.qq.com/newbaoliao/最新报料的内容? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 用IDHTTP.GET的方法就可以呀!编码为UTF-8然后使用正则或者自己截取的方式将最新报料的内容得到 不对哦。那个貌似是用JS输出的,直接GET抓取不到 不对哦。那个貌似是用JS输出的,直接GET抓取不到 idhttp不太清楚,一般都是用Com接口的,也挺方便。例如常用的 ihtmldocument2 那个网页中这样显示数据:<XMP id="feed_template" style="display:none;"> <table cellspacing="0" cellpadding="0" border="0" class="w1"> <tr class="theader" style="font:bolder"> <td width="255" class="bllisttit table6" height="25">问题</td> <td width="145" class="bllisttit table6" >日期</td> <td width="85" class="bllisttit table6" >回复/浏览</td> <td width="75" class="bllisttit table6" >状态</td> </tr> {for p in content_list} <tr> <td width="255" class="bllisttit table6" height="45"><a href="http://hb.qq.com/newbaoliao/detail.htm?${p.content_id}" target="_blank">${p.title}</a></td> <td width="145" class="bllisttit table6" >${p.c_time}</td> <td width="85" class="bllisttit table6" ><span id="reply_${p.content_id}">-</span>/<span id="view_${p.content_id}">-</span></td> <td width="75" class="bllisttit table6"><span id="status_${p.content_id}">-</span></td> </tr> {forelse} <tr> <td colspan="4">还没有网友发布报料</td> </tr> {/for}这个是JS输出,直接GET不到。怎么办? 搜索引擎都不好抓取JS生成的DOM,更不用说IDHTTP了获取ajax的数据,用XMLHTTP XMLHTTP不会用,能给个简短的例子吗?比如获取上面那个链接(http://hb.qq.com/newbaoliao/——中的内容该如何做呢? XMLHTTP不会用,能给个简短的例子吗?比如获取上面那个链接(http://hb.qq.com/newbaoliao/——中的内容该如何做呢? 请善用搜索引擎uses MsXML;var req: IXMLHTTPRequest;begin req := CoXMLHTTP.Create; // 较早的版本或许是req:=CoXMLHTTPRequest.Create; req.open('Get', 'http://hb.qq.com/newbaoliao', False, { Username } EmptyParam, { Passwort }EmptyParam); req.send(EmptyParam); Memo1.Text := req.responseText;end; CoXMLHTTP对象没有用,换CoXMLHTTPRequest可以运行。但是结果仍然没有获取到应有的信息,和IDHTTP得到的内容一样。是不是后面参数的问题啊?拜托帮我看看。 CoXMLHTTP对象没有用,换CoXMLHTTPRequest可以运行。但是结果仍然没有获取到应有的信息,和IDHTTP得到的内容一样。是不是后面参数的问题啊?拜托帮我看看。 idhttp取不到的吧,貌似js脚本是要下载到本地解析才能输出内容的,idhttp又不会解析js脚本。要么你自己写个js脚本解析器,要么用Webbrowser; idhttp直接就可以搞定了呀! http://c2.area.qq.com/baoliao/jsdata/baoliao_content_list_9.js内容在这里 data_list = {"total":"45975","content_list":[{"content_id":"185648","title":"\u5927\u609f\u4e2d\u8003\u4e25\u91cd\u6284\u88ad\uff0c\u8003\u751f\u5e26\u624b\u673a\u821e\u5f0a","nick":"","c_time":"2011\/06\/21 10:39"},{"content_id":"185644","title":"\u5b9c\u660c\u6cf0\u6c5f\u7f6e\u4e1a\u6c5f\u4e34\u5929\u4e0b\u5c0f\u533a\u5916\u5899\u7816\u8131\u843d\uff0c\u4e1a\u4e3b\u4f24\u4e0d\u8d77","nick":"","c_time":"2011\/06\/21 10:27"},{"content_id":"185642","title":"\u8001\u5e08\u8d2a\u6c61\u5b66\u751f\u8d39\u7528\u6700\u4f4e\u4e09\u5341\u4e07\uff0c\u5b66\u6821\u5305\u5e87","nick":"","c_time":"2011\/06\/21 10:25"},{"content_id":"185633","title":"\u4e2d\u8003","nick":"","c_time":"2011\/06\/21 \u5927等这个怎么和汉字对应? 这个是一种编码吧?utf8还是啥? 想搞破坏呀>>>>>>>>> javascript -----------> unescape函数 这个用delphi可以解开,\u5927 = utf8($5927) 怎么转自己试试 utf8($5927),这个函数具体叫什么名字呢? utf8($5927),这个函数具体叫什么名字呢? utf8($5927),这个函数具体叫什么名字呢? 将\换成%再unescape解密就可以了 delphi中字符串中如何输入单引号? interbase 创建存储过程的问题,急------,在线等 请问各位一般怎么处理数据库里查询得到的数据,再将处理后的结果呈现给用户? 如何得到ocx的路径 很菜的问题 请教各位,如何用程序改变《控制面板》里面的日期格式 请给小妹帮个忙 谁读过《DELPHI 5企业级解决方案及应用剖析》 请大家指点迷津!急呀! 使用了DBGrid和DBNav控件,要求在插入新记录时,给DBGrid的某个单元格由程序自动加上一个值,不要由用户填写!如何做? 编译老项目时,缺少imageinout.dcu,这是什么控件? DLL查询问题
编码为UTF-8
然后使用正则或者自己截取的方式将最新报料的内容得到
<XMP id="feed_template" style="display:none;">
<table cellspacing="0" cellpadding="0" border="0" class="w1">
<tr class="theader" style="font:bolder">
<td width="255" class="bllisttit table6" height="25">问题</td>
<td width="145" class="bllisttit table6" >日期</td>
<td width="85" class="bllisttit table6" >回复/浏览</td>
<td width="75" class="bllisttit table6" >状态</td>
</tr>
{for p in content_list}
<tr>
<td width="255" class="bllisttit table6" height="45"><a href="http://hb.qq.com/newbaoliao/detail.htm?${p.content_id}" target="_blank">${p.title}</a></td>
<td width="145" class="bllisttit table6" >${p.c_time}</td>
<td width="85" class="bllisttit table6" ><span id="reply_${p.content_id}">-</span>/<span id="view_${p.content_id}">-</span></td>
<td width="75" class="bllisttit table6"><span id="status_${p.content_id}">-</span></td>
</tr>
{forelse}
<tr>
<td colspan="4">还没有网友发布报料</td>
</tr>
{/for}这个是JS输出,直接GET不到。怎么办?
获取ajax的数据,用XMLHTTP
req: IXMLHTTPRequest;
begin
req := CoXMLHTTP.Create; // 较早的版本或许是req:=CoXMLHTTPRequest.Create;
req.open('Get', 'http://hb.qq.com/newbaoliao', False, { Username } EmptyParam, { Passwort }EmptyParam);
req.send(EmptyParam);
Memo1.Text := req.responseText;
end;
这个用delphi可以解开,\u5927 = utf8($5927) 怎么转自己试试