关于抓取网页内容的问题.

时间:2021-04-01 18:26:48
我想抓取这个页面的内容(如图),要怎样实现了?图片上这些数据是通过ajax获取到后显示在页面的.直接抓取得到的html没有相应的值,我想得到如图片上的那些相应的数值,要怎样实现了?请哪位大哥帮我贴段代码出来,好不?谢谢大家了! 关于抓取网页内容的问题.
http://www.cq315house.com/aestate_cq/businessweb/showout.asp?stanid=55&mainno=1&activeid=&reftype=&acttype=1&permitmode=&participantno=1&editflag=show&buildid=18013136 点击这个链接就进行要抓取页面,这个页面就是我想要的东西

13 个解决方案

#1


没有人知道嘛?

#2


Ajax是异步刷新,直接GET压根就没值,需要浏览器组件执行js才可以。

#3


能具体点嘛?不太明白呀.

#4


ajax加载的数据。不好抓取!
走这条路估计很艰难

#5


http://www.cq315house.com/aestate_cq/AppShell/remoteServer.asp
内容页
POST方式
<root mytype="Select" serverFile="remoteServer.asp" connsessionname="remote_ConnectedToDatabase" sortstr="" sum="" accumulative=""><namestr>select bldroomid,roomNo,part,buildUnit,floorOn,landArea,BUILDAREA,SETAREA,useArea,0 as balconyArea,publicArea,isApplySale,-1 as isCanSale,isHaveSign,isHaveRegist,0 as isHaveSale,price,totalValue,0 isRelativeRoom,isLimit,useStatus,ismortgage,'' as floorname,-1 as hasPermited,isSubscribe,cconid,sconid,0 as ifpri,getsjzd(structure,'鎴垮眿缁撴瀯') jg,getsjzd(roomtype,'鎴峰瀷') hx,getsjzd(usage,'鎴垮眿鐢ㄩ€?) yt,gethousename(bldroomid) fjh,nodeid qxfh,isrestrict,isreal from vw_bldroom a where a.buildid='18013136' order by floorOn desc,roomno</namestr></root>

#6


我菜鸟一个.要怎样post过去.可以贴段代码出来嘛?

#7


菜鸟 飞过

#8


帮你破解一些代码,太长,粘贴一部分

<!--
//clientxmldoc结构
//<root>
// <state></state>
// <cols>
// <col>
// <Name></Name>
// <DefinedSize></DefinedSize>
// <Type></Type>
// <Precision></Precision>
// <NumericScale></NumericScale>
// </col>
// .....
// </cols>
// <accumulative>
// <col>
// <Name></Name>
// </col>
// .....
// </accumulative>
// <node>
// <row>
// <col></col>
// ......
// </row>
// ......
// </node>
// <sum>
// <no></no>
// <data></data>
// ......
// </sum>
//</root>
var appPath;
var server_root_rds;
//----------------------------------------------------------------------
function remoteObject(){
this.appPath=remoteObjectInit_appPath();
this.server_root_rds=remoteObjectInit_server_root_rds();
this.createD=remoteCreateD();
this.xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
this.clientxmldoc = new ActiveXObject("Msxml.DOMDocument");
this.clientxmldoc_b = new ActiveXObject("Msxml.DOMDocument");
this.serverFile='remoteServer.asp';
this.connSessionName='remote_ConnectedToDatabase';
this.dataBaseType=0;//0:ORACLE,1:SQLSERVER,2:MSACCESS,3:IBMDB2
this.root;
this.root_b;
this.treeSort=false;
this.id = 1;
}
//----------------------------------------------------------------------
//----------------------------------------------------------------------
function remoteObjectInit_appPath(){
if(window.top.appPath+''=='undefined')return window.appPath;
else return window.top.appPath;
}
//----------------------------------------------------------------------
function remoteObjectInit_server_root_rds(){
if(window.top.appPath=='undefined')return server_root_rds;
else return window.top.server_root_rds;
}
//----------------------------------------------------------------------
function remoteCreateD(){
if(window.top.document.body.getAttribute('catchDictionary')+''!='null')return;
window.top.document.body.setAttribute('catchDictionary',new ActiveXObject("Scripting.Dictionary"));
}
//----------------------------------------------------------------------
function remotegetCatch(nameStr){
var d = window.top.document.body.getAttribute('catchDictionary');
if (d.Exists(nameStr))return d.Item(nameStr);
else return null;
}
//----------------------------------------------------------------------
function remotesetCatch(nameStr,valueObj){
var d = window.top.document.body.getAttribute('catchDictionary');
if (d.Exists(nameStr))d.Remove(nameStr);
d.Add(nameStr,valueObj);
}
//----------------------------------------------------------------------
function remotegetTableFields(tabmeName,databasetype){
var sqlStr;
if(databasetype.search('MS ACCESS')>=0 || databasetype.search('SQL SERVER')>=0){
sqlStr = "select top 1 * from " + tabmeName;
}else{
sqlStr = "select * from " + tabmeName + " where rownum<=1";
}
var ts = this.getResultTable(sqlStr);
if(ts!='0'){
return ts;
}else{
var fieldsName = new Array();
for(var i=0;i<this.root.selectSingleNode('cols').childNodes.length;i++){
fieldsName[i]=this.root.selectSingleNode('cols').childNodes[i].childNodes[0].text;
}
for(;this.root.selectSingleNode('cols').childNodes.length>1;){
this.root.selectSingleNode('cols').removeChild(this.root.selectSingleNode('cols').childNodes[1]);
}
this.root.selectSingleNode('cols').childNodes[0].childNodes[0].text = 'FIELDNAME';
for(;this.root.selectSingleNode('node').childNodes.length>0;){
this.root.selectSingleNode('node').removeChild(this.root.selectSingleNode('node').childNodes[0]);
}
for(var i=0;i<fieldsName.length;i++){
this.insertBeforeRow(i);
}
for(var i=0;i<fieldsName.length;i++){
this.setResultTableData(i,0,fieldsName[i]);
}
return '0';
}
}
//----------------------------------------------------------------------
function commonXmlHttp(xmlhttp,xmldoc){
var pmax;
var pmin;
var pvalue;
if(typeof(window.top.ProgressBarGrid)+''=='object'){
pmax = window.top.ProgressBarGrid.Max;
pmin = window.top.ProgressBarGrid.Min;
pvalue = window.top.ProgressBarGrid.Value;
window.top.ProgressBarGrid.Max = 2;
window.top.ProgressBarGrid.Min = 0;
window.top.ProgressBarGrid.Value = 1;
}
xmlhttp.Open("POST",this.appPath+"/AppShell/"+this.serverFile+"",false);
var ts=new Date();
window.status='XML通讯开始:'+this.getDateFieldStr(ts);
var t1=(ts.getTime());
xmlhttp.Send(xmldoc.xml);
    var te=new Date();
var t2=(te.getTime());
window.top.status='XML通讯耗时:'+(t2-t1)+'毫秒!'
    if(typeof(window.top.ProgressBarGrid)+''=='object'){
window.top.ProgressBarGrid.Max = pmax;
window.top.ProgressBarGrid.Min = pmin;
window.top.ProgressBarGrid.Value = pvalue;
}
    if(xmlhttp.status!=200)return '网络故障(xmlhttp.status='+xmlhttp.status+'),请稍后再试!';
    return '0'
}

....
//--> 

#9



//----------------------------------------------------------------------
function remoteexecuteSqlAsyn(dmlArray,callBackFunction){    //异步执行调用
var xmldoc = new ActiveXObject("Msxml.DOMDocument");
var root = xmldoc.createNode("element","root","");
xmldoc.appendChild(root);
root.setAttribute('mytype','executeSql');
root.setAttribute('serverFile',this.serverFile);
if(this.connSessionName!='')root.setAttribute('connsessionname',this.connSessionName);
for(var i=0;i<dmlArray.length;i++){
var onode = xmldoc.createNode("element","dmlstatement","");
onode.text = dmlArray[i];
xmldoc.documentElement.appendChild(onode);
}

eval("this.xmlhttp.OnReadyStateChange = "+callBackFunction);
this.xmlhttp.Open("POST",this.appPath+"/AppShell/"+this.serverFile+"",true);
this.xmlhttp.Send(xmldoc.xml);
return '0';
}
//----------------------------------------------------------------------
function remotegetResultTableAsyn(selectstr,callBackFunction){//异步取数据调用
var ts=this.trim(selectstr.toUpperCase())
if(ts.substr(0,6)!='SELECT'){
return '句法错!';
}
var AttributeArray=new Array('','','','');
AttributeArray = selectstr.split('~~');//SQL串~~排序串(1 ASC,2 DESC)~~合计列(0,3)~~累积列(2,3)
var xmldoc = new ActiveXObject("Msxml.DOMDocument");
var root = xmldoc.createNode("element","root","");
xmldoc.appendChild(root);
root.setAttribute('mytype','Select');
root.setAttribute('serverFile',this.serverFile);
if(this.connSessionName!='')root.setAttribute('connsessionname',this.connSessionName);
root.setAttribute('sortstr',AttributeArray[1]);//排序
root.setAttribute('sum',AttributeArray[2]);//合计
root.setAttribute('accumulative',AttributeArray[3]);//累计
var onode = xmldoc.createNode("element",'namestr',"");
AttributeArray[0] = this.trim(AttributeArray[0]);
onode.text = AttributeArray[0];
xmldoc.documentElement.appendChild(onode);

eval("this.xmlhttp.OnReadyStateChange = "+callBackFunction);
this.xmlhttp.Open("POST",this.appPath+"/AppShell/"+this.serverFile+"",true);
this.xmlhttp.Send(xmldoc.xml);
return '0';
}
//----------------------------------------------------------------------
function remotecallBackAsyn(){//异步取数据回调
if(this.xmlhttp.Status!=200){
return '错误状态码:' + this.xmlhttp.Status + "\n错误状态文本:" + this.xmlhttp.StatusText + "\n所有反馈信息:\n" + this.xmlhttp.GetAllResponseHeaders();
}
this.clientxmldoc = this.xmlhttp.responseXML;
this.root = this.clientxmldoc.documentElement;
if(this.root.selectSingleNode("state").text!='OK')return this.root.selectSingleNode("state").text;
return '0';
}

#10


上面这个代码我解密出来了的.只是我不知道怎样改.我是以下面方式改的.但没有什么反映?为什么了?

<script type="text/javascript">
        var XmlHttp=new ActiveXObject("Microsoft.XMLhttp");
        function SetArea()
        {
            var strSQL="select bldroomid,roomNo,part,buildUnit,floorOn,landArea,BUILDAREA,SETAREA,useArea,0 as balconyArea,publicArea,isApplySale,-1 as isCanSale,isHaveSign,isHaveRegist,0 as isHaveSale,price,totalValue,0 isRelativeRoom,isLimit,useStatus,ismortgage,'' as floorname,-1 as hasPermited,isSubscribe,cconid,sconid,0 as ifpri,getsjzd(structure,'房屋结构') jg,getsjzd(roomtype,'户型') hx,getsjzd(usage,'房屋用途') yt,gethousename(bldroomid) fjh,nodeid qxfh,isrestrict,isreal from vw_bldroom a where a.buildid='18013136' order by floorOn desc,roomno";
        
            var xmldoc = new ActiveXObject("Msxml.DOMDocument");
    var root = xmldoc.createNode("element","root","");
    xmldoc.appendChild(root);
    root.setAttribute('mytype','Select');
    root.setAttribute('serverFile','remoteServer.asp');
    root.setAttribute('connsessionname','remote_ConnectedToDatabase');
    root.setAttribute('sortstr','');//排序
    root.setAttribute('sum','');//合计
    root.setAttribute('accumulative','');//累计
    
    var onode = xmldoc.createNode("element",'namestr',"");     
    onode.text =strSQL;
    xmldoc.documentElement.appendChild(onode);
    
    
    //http://www.cq315house.com/aestate_cq/AppShell/
    this.XmlHttp.Open("POST","http://www.cq315house.com/aestate_cq/AppShell/remoteServer.asp",true);
    this.XmlHttp.Send(xmldoc.xml);     
    
    XmlHttp.onreadystatechange=MenuProcess;

        }
           
        function MenuProcess()
        {        
            if(XmlHttp.readystate==4 || XmlHttp.readystate=='complete') 
            {
                this.clientxmldoc = new ActiveXObject("Msxml.DOMDocument");
                //var result = XmlHttp.responsetext;   
                this.clientxmldoc = xmlhttp.responseXML;
            this.root = this.clientxmldoc.documentElement;
                
                alert(this.root.selectSingleNode("state").text);
             }
             
         }     
         

    </script>

这样写对嘛?为什么得不到任何数据了?我监控MenuProcess这个,感觉根本就没有进入这个函数?为什么?如果把http://www.cq315house.com/aestate_cq/AppShell/remoteServer.asp这个改成本机的,都可以成功呀?为什么在服务器上不行了?

#11


经测试,可以出结果

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
</head>

<body>
<p onclick="SetArea()">Click</p>

<script language="javascript" type="text/javascript">
var XmlHttp=new ActiveXObject("Microsoft.XMLhttp");
function SetArea()
{
var strSQL="select bldroomid,roomNo,part,buildUnit,floorOn,landArea,BUILDAREA,SETAREA,useArea,0 as balconyArea,publicArea,isApplySale,-1 as isCanSale,isHaveSign,isHaveRegist,0 as isHaveSale,price,totalValue,0 isRelativeRoom,isLimit,useStatus,ismortgage,'' as floorname,-1 as hasPermited,isSubscribe,cconid,sconid,0 as ifpri,getsjzd(structure,'房屋结构') jg,getsjzd(roomtype,'户型') hx,getsjzd(usage,'房屋用途') yt,gethousename(bldroomid) fjh,nodeid qxfh,isrestrict,isreal from vw_bldroom a where a.buildid='18013136' order by floorOn desc,roomno";

var xmldoc = new ActiveXObject("Msxml.DOMDocument");
var root = xmldoc.createNode("element","root","");
xmldoc.appendChild(root);
root.setAttribute('mytype','Select');
root.setAttribute('serverFile','remoteServer.asp');
root.setAttribute('connsessionname','remote_ConnectedToDatabase');
root.setAttribute('sortstr','');//排序
root.setAttribute('sum','');//合计
root.setAttribute('accumulative','');//累计

var onode = xmldoc.createNode("element",'namestr',"");   
onode.text =strSQL;
xmldoc.documentElement.appendChild(onode);

//http://www.cq315house.com/aestate_cq/AppShell/
this.XmlHttp.Open("POST","http://www.cq315house.com/aestate_cq/AppShell/remoteServer.asp",true);
this.XmlHttp.Send(xmldoc.xml);   

XmlHttp.onreadystatechange=MenuProcess;

}

function MenuProcess()
{   
if(XmlHttp.readystate==4 || XmlHttp.readystate=='complete')  
{
alert(XmlHttp.responseText);
}
}   

</script>
</body>
</html>

#12


引用 3 楼 chenyang80425 的回复:
能具体点嘛?不太明白呀.

GET只能获取到前台要执行的代码,而Ajax需要执行这些代码之后才有值。

#13


用免费在线软件MetaSeeker,单个网页上的AJAX内容是很容易提取的,即将发布的4.11.0版本可以提取AJAX导航的多页语义结构不同的内容。

#1


没有人知道嘛?

#2


Ajax是异步刷新,直接GET压根就没值,需要浏览器组件执行js才可以。

#3


能具体点嘛?不太明白呀.

#4


ajax加载的数据。不好抓取!
走这条路估计很艰难

#5


http://www.cq315house.com/aestate_cq/AppShell/remoteServer.asp
内容页
POST方式
<root mytype="Select" serverFile="remoteServer.asp" connsessionname="remote_ConnectedToDatabase" sortstr="" sum="" accumulative=""><namestr>select bldroomid,roomNo,part,buildUnit,floorOn,landArea,BUILDAREA,SETAREA,useArea,0 as balconyArea,publicArea,isApplySale,-1 as isCanSale,isHaveSign,isHaveRegist,0 as isHaveSale,price,totalValue,0 isRelativeRoom,isLimit,useStatus,ismortgage,'' as floorname,-1 as hasPermited,isSubscribe,cconid,sconid,0 as ifpri,getsjzd(structure,'鎴垮眿缁撴瀯') jg,getsjzd(roomtype,'鎴峰瀷') hx,getsjzd(usage,'鎴垮眿鐢ㄩ€?) yt,gethousename(bldroomid) fjh,nodeid qxfh,isrestrict,isreal from vw_bldroom a where a.buildid='18013136' order by floorOn desc,roomno</namestr></root>

#6


我菜鸟一个.要怎样post过去.可以贴段代码出来嘛?

#7


菜鸟 飞过

#8


帮你破解一些代码,太长,粘贴一部分

<!--
//clientxmldoc结构
//<root>
// <state></state>
// <cols>
// <col>
// <Name></Name>
// <DefinedSize></DefinedSize>
// <Type></Type>
// <Precision></Precision>
// <NumericScale></NumericScale>
// </col>
// .....
// </cols>
// <accumulative>
// <col>
// <Name></Name>
// </col>
// .....
// </accumulative>
// <node>
// <row>
// <col></col>
// ......
// </row>
// ......
// </node>
// <sum>
// <no></no>
// <data></data>
// ......
// </sum>
//</root>
var appPath;
var server_root_rds;
//----------------------------------------------------------------------
function remoteObject(){
this.appPath=remoteObjectInit_appPath();
this.server_root_rds=remoteObjectInit_server_root_rds();
this.createD=remoteCreateD();
this.xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
this.clientxmldoc = new ActiveXObject("Msxml.DOMDocument");
this.clientxmldoc_b = new ActiveXObject("Msxml.DOMDocument");
this.serverFile='remoteServer.asp';
this.connSessionName='remote_ConnectedToDatabase';
this.dataBaseType=0;//0:ORACLE,1:SQLSERVER,2:MSACCESS,3:IBMDB2
this.root;
this.root_b;
this.treeSort=false;
this.id = 1;
}
//----------------------------------------------------------------------
//----------------------------------------------------------------------
function remoteObjectInit_appPath(){
if(window.top.appPath+''=='undefined')return window.appPath;
else return window.top.appPath;
}
//----------------------------------------------------------------------
function remoteObjectInit_server_root_rds(){
if(window.top.appPath=='undefined')return server_root_rds;
else return window.top.server_root_rds;
}
//----------------------------------------------------------------------
function remoteCreateD(){
if(window.top.document.body.getAttribute('catchDictionary')+''!='null')return;
window.top.document.body.setAttribute('catchDictionary',new ActiveXObject("Scripting.Dictionary"));
}
//----------------------------------------------------------------------
function remotegetCatch(nameStr){
var d = window.top.document.body.getAttribute('catchDictionary');
if (d.Exists(nameStr))return d.Item(nameStr);
else return null;
}
//----------------------------------------------------------------------
function remotesetCatch(nameStr,valueObj){
var d = window.top.document.body.getAttribute('catchDictionary');
if (d.Exists(nameStr))d.Remove(nameStr);
d.Add(nameStr,valueObj);
}
//----------------------------------------------------------------------
function remotegetTableFields(tabmeName,databasetype){
var sqlStr;
if(databasetype.search('MS ACCESS')>=0 || databasetype.search('SQL SERVER')>=0){
sqlStr = "select top 1 * from " + tabmeName;
}else{
sqlStr = "select * from " + tabmeName + " where rownum<=1";
}
var ts = this.getResultTable(sqlStr);
if(ts!='0'){
return ts;
}else{
var fieldsName = new Array();
for(var i=0;i<this.root.selectSingleNode('cols').childNodes.length;i++){
fieldsName[i]=this.root.selectSingleNode('cols').childNodes[i].childNodes[0].text;
}
for(;this.root.selectSingleNode('cols').childNodes.length>1;){
this.root.selectSingleNode('cols').removeChild(this.root.selectSingleNode('cols').childNodes[1]);
}
this.root.selectSingleNode('cols').childNodes[0].childNodes[0].text = 'FIELDNAME';
for(;this.root.selectSingleNode('node').childNodes.length>0;){
this.root.selectSingleNode('node').removeChild(this.root.selectSingleNode('node').childNodes[0]);
}
for(var i=0;i<fieldsName.length;i++){
this.insertBeforeRow(i);
}
for(var i=0;i<fieldsName.length;i++){
this.setResultTableData(i,0,fieldsName[i]);
}
return '0';
}
}
//----------------------------------------------------------------------
function commonXmlHttp(xmlhttp,xmldoc){
var pmax;
var pmin;
var pvalue;
if(typeof(window.top.ProgressBarGrid)+''=='object'){
pmax = window.top.ProgressBarGrid.Max;
pmin = window.top.ProgressBarGrid.Min;
pvalue = window.top.ProgressBarGrid.Value;
window.top.ProgressBarGrid.Max = 2;
window.top.ProgressBarGrid.Min = 0;
window.top.ProgressBarGrid.Value = 1;
}
xmlhttp.Open("POST",this.appPath+"/AppShell/"+this.serverFile+"",false);
var ts=new Date();
window.status='XML通讯开始:'+this.getDateFieldStr(ts);
var t1=(ts.getTime());
xmlhttp.Send(xmldoc.xml);
    var te=new Date();
var t2=(te.getTime());
window.top.status='XML通讯耗时:'+(t2-t1)+'毫秒!'
    if(typeof(window.top.ProgressBarGrid)+''=='object'){
window.top.ProgressBarGrid.Max = pmax;
window.top.ProgressBarGrid.Min = pmin;
window.top.ProgressBarGrid.Value = pvalue;
}
    if(xmlhttp.status!=200)return '网络故障(xmlhttp.status='+xmlhttp.status+'),请稍后再试!';
    return '0'
}

....
//--> 

#9



//----------------------------------------------------------------------
function remoteexecuteSqlAsyn(dmlArray,callBackFunction){    //异步执行调用
var xmldoc = new ActiveXObject("Msxml.DOMDocument");
var root = xmldoc.createNode("element","root","");
xmldoc.appendChild(root);
root.setAttribute('mytype','executeSql');
root.setAttribute('serverFile',this.serverFile);
if(this.connSessionName!='')root.setAttribute('connsessionname',this.connSessionName);
for(var i=0;i<dmlArray.length;i++){
var onode = xmldoc.createNode("element","dmlstatement","");
onode.text = dmlArray[i];
xmldoc.documentElement.appendChild(onode);
}

eval("this.xmlhttp.OnReadyStateChange = "+callBackFunction);
this.xmlhttp.Open("POST",this.appPath+"/AppShell/"+this.serverFile+"",true);
this.xmlhttp.Send(xmldoc.xml);
return '0';
}
//----------------------------------------------------------------------
function remotegetResultTableAsyn(selectstr,callBackFunction){//异步取数据调用
var ts=this.trim(selectstr.toUpperCase())
if(ts.substr(0,6)!='SELECT'){
return '句法错!';
}
var AttributeArray=new Array('','','','');
AttributeArray = selectstr.split('~~');//SQL串~~排序串(1 ASC,2 DESC)~~合计列(0,3)~~累积列(2,3)
var xmldoc = new ActiveXObject("Msxml.DOMDocument");
var root = xmldoc.createNode("element","root","");
xmldoc.appendChild(root);
root.setAttribute('mytype','Select');
root.setAttribute('serverFile',this.serverFile);
if(this.connSessionName!='')root.setAttribute('connsessionname',this.connSessionName);
root.setAttribute('sortstr',AttributeArray[1]);//排序
root.setAttribute('sum',AttributeArray[2]);//合计
root.setAttribute('accumulative',AttributeArray[3]);//累计
var onode = xmldoc.createNode("element",'namestr',"");
AttributeArray[0] = this.trim(AttributeArray[0]);
onode.text = AttributeArray[0];
xmldoc.documentElement.appendChild(onode);

eval("this.xmlhttp.OnReadyStateChange = "+callBackFunction);
this.xmlhttp.Open("POST",this.appPath+"/AppShell/"+this.serverFile+"",true);
this.xmlhttp.Send(xmldoc.xml);
return '0';
}
//----------------------------------------------------------------------
function remotecallBackAsyn(){//异步取数据回调
if(this.xmlhttp.Status!=200){
return '错误状态码:' + this.xmlhttp.Status + "\n错误状态文本:" + this.xmlhttp.StatusText + "\n所有反馈信息:\n" + this.xmlhttp.GetAllResponseHeaders();
}
this.clientxmldoc = this.xmlhttp.responseXML;
this.root = this.clientxmldoc.documentElement;
if(this.root.selectSingleNode("state").text!='OK')return this.root.selectSingleNode("state").text;
return '0';
}

#10


上面这个代码我解密出来了的.只是我不知道怎样改.我是以下面方式改的.但没有什么反映?为什么了?

<script type="text/javascript">
        var XmlHttp=new ActiveXObject("Microsoft.XMLhttp");
        function SetArea()
        {
            var strSQL="select bldroomid,roomNo,part,buildUnit,floorOn,landArea,BUILDAREA,SETAREA,useArea,0 as balconyArea,publicArea,isApplySale,-1 as isCanSale,isHaveSign,isHaveRegist,0 as isHaveSale,price,totalValue,0 isRelativeRoom,isLimit,useStatus,ismortgage,'' as floorname,-1 as hasPermited,isSubscribe,cconid,sconid,0 as ifpri,getsjzd(structure,'房屋结构') jg,getsjzd(roomtype,'户型') hx,getsjzd(usage,'房屋用途') yt,gethousename(bldroomid) fjh,nodeid qxfh,isrestrict,isreal from vw_bldroom a where a.buildid='18013136' order by floorOn desc,roomno";
        
            var xmldoc = new ActiveXObject("Msxml.DOMDocument");
    var root = xmldoc.createNode("element","root","");
    xmldoc.appendChild(root);
    root.setAttribute('mytype','Select');
    root.setAttribute('serverFile','remoteServer.asp');
    root.setAttribute('connsessionname','remote_ConnectedToDatabase');
    root.setAttribute('sortstr','');//排序
    root.setAttribute('sum','');//合计
    root.setAttribute('accumulative','');//累计
    
    var onode = xmldoc.createNode("element",'namestr',"");     
    onode.text =strSQL;
    xmldoc.documentElement.appendChild(onode);
    
    
    //http://www.cq315house.com/aestate_cq/AppShell/
    this.XmlHttp.Open("POST","http://www.cq315house.com/aestate_cq/AppShell/remoteServer.asp",true);
    this.XmlHttp.Send(xmldoc.xml);     
    
    XmlHttp.onreadystatechange=MenuProcess;

        }
           
        function MenuProcess()
        {        
            if(XmlHttp.readystate==4 || XmlHttp.readystate=='complete') 
            {
                this.clientxmldoc = new ActiveXObject("Msxml.DOMDocument");
                //var result = XmlHttp.responsetext;   
                this.clientxmldoc = xmlhttp.responseXML;
            this.root = this.clientxmldoc.documentElement;
                
                alert(this.root.selectSingleNode("state").text);
             }
             
         }     
         

    </script>

这样写对嘛?为什么得不到任何数据了?我监控MenuProcess这个,感觉根本就没有进入这个函数?为什么?如果把http://www.cq315house.com/aestate_cq/AppShell/remoteServer.asp这个改成本机的,都可以成功呀?为什么在服务器上不行了?

#11


经测试,可以出结果

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
</head>

<body>
<p onclick="SetArea()">Click</p>

<script language="javascript" type="text/javascript">
var XmlHttp=new ActiveXObject("Microsoft.XMLhttp");
function SetArea()
{
var strSQL="select bldroomid,roomNo,part,buildUnit,floorOn,landArea,BUILDAREA,SETAREA,useArea,0 as balconyArea,publicArea,isApplySale,-1 as isCanSale,isHaveSign,isHaveRegist,0 as isHaveSale,price,totalValue,0 isRelativeRoom,isLimit,useStatus,ismortgage,'' as floorname,-1 as hasPermited,isSubscribe,cconid,sconid,0 as ifpri,getsjzd(structure,'房屋结构') jg,getsjzd(roomtype,'户型') hx,getsjzd(usage,'房屋用途') yt,gethousename(bldroomid) fjh,nodeid qxfh,isrestrict,isreal from vw_bldroom a where a.buildid='18013136' order by floorOn desc,roomno";

var xmldoc = new ActiveXObject("Msxml.DOMDocument");
var root = xmldoc.createNode("element","root","");
xmldoc.appendChild(root);
root.setAttribute('mytype','Select');
root.setAttribute('serverFile','remoteServer.asp');
root.setAttribute('connsessionname','remote_ConnectedToDatabase');
root.setAttribute('sortstr','');//排序
root.setAttribute('sum','');//合计
root.setAttribute('accumulative','');//累计

var onode = xmldoc.createNode("element",'namestr',"");   
onode.text =strSQL;
xmldoc.documentElement.appendChild(onode);

//http://www.cq315house.com/aestate_cq/AppShell/
this.XmlHttp.Open("POST","http://www.cq315house.com/aestate_cq/AppShell/remoteServer.asp",true);
this.XmlHttp.Send(xmldoc.xml);   

XmlHttp.onreadystatechange=MenuProcess;

}

function MenuProcess()
{   
if(XmlHttp.readystate==4 || XmlHttp.readystate=='complete')  
{
alert(XmlHttp.responseText);
}
}   

</script>
</body>
</html>

#12


引用 3 楼 chenyang80425 的回复:
能具体点嘛?不太明白呀.

GET只能获取到前台要执行的代码,而Ajax需要执行这些代码之后才有值。

#13


用免费在线软件MetaSeeker,单个网页上的AJAX内容是很容易提取的,即将发布的4.11.0版本可以提取AJAX导航的多页语义结构不同的内容。