如何从网页文本数据

问题描述 投票:0回答:1

我想获得的数据形成了制度网站使用XMLHttpRequest的但不是数据我收到错误页面,请帮助

我的代码: -

var url = '[https://tsecet.nic.in/institute_details.aspx?iCode=JNTH][3]';
var xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function() {
    if (this.readyState == 4 && this.status == 200) {
       // Typical action to be performed when the document is ready:
       document.write( this.responseText);
    }
}

xhttp.open("GET", url , true);
xhttp.send();

目标网页地址: - https://tsecet.nic.in/institute_details.aspx?iCode=JNTH

如果我尝试打开 https://tsecet.nic.in/Default.aspx >>然后点击>> institute profile >>然后点击>> JNTH然后我能够得到的浏览器数据否则我重定向到一个错误页面

请帮我...

注意

我试图从不同的网站,不同的域本网站中的aspx脚本得到这个数据

javascript html asp.net xmlhttprequest asp.net-ajax
1个回答
2
投票

Ajax请求你想运行不能这样做,因为页面具有X-XSS-Protection: 1头,blocking such requests。这看起来好像它们允许内部URI来仅在“帧”的主页设置启动。不幸的是,我不能告诉是肯定的。总之,你将需要另一种方法。

© www.soinside.com 2019 - 2024. All rights reserved.