如何在我的表单上获取另一个站点的源代码 [英] how to get the source code of another site on my form

查看:59
本文介绍了如何在我的表单上获取另一个站点的源代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望能够抓取另一个网站的源代码,并将它/

放入我表单上的字段中,以便我可以从中获取信息。


该网站是:
http://www.oddschecker.com/oddscheck...16x/sid/520998


(您可能需要将559716更改为一个更大的数字,如果它不是
工作)


任何人都可以帮忙吗?我已经尝试了一些像view.source,iframes

这样的东西但要么做错了要么被阻止了。


谢谢

Paul

I would like to be able to grab another sites source code and put it
into a field on my form so that I can then grab information from it.

The website is :
http://www.oddschecker.com/oddscheck...16x/sid/520998

(You may need to change the 559716 to a larger number if it doesn''t
work)

Can anyone help ? I have tried a few things like view.source, iframes
but am either doing things wrong or they are being blocked.

Thanks
Paul

推荐答案

" trower" < PA ********* @ mottmac.com>在消息中写道

news:11 ********************** @ f14g2000cwb.googlegr oups.com ...
"trower" <pa*********@mottmac.com> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com...
我希望能够抓取另一个网站的源代码并将其放入我的表单上的字段中,以便我可以从中获取信息。

该网站是:
http: //www.oddschecker.com/oddscheck...s/559716x/sid/

520998
(如果没有,您可能需要将559716更改为更大的数字't
工作)

任何人都可以帮忙吗?我已经尝试了一些像view.source,iframe这样的东西,但是要么做错了要么被阻止了。

谢谢
Paul
I would like to be able to grab another sites source code and put it
into a field on my form so that I can then grab information from it.

The website is :
http://www.oddschecker.com/oddscheck...s/559716x/sid/
520998
(You may need to change the 559716 to a larger number if it doesn''t
work)

Can anyone help ? I have tried a few things like view.source, iframes
but am either doing things wrong or they are being blocked.

Thanks
Paul




这会有帮助吗?请注意自动换行。


< html>

< head>

< title> oddschecker.htm< / title>

< script type =" text / javascript">

function Odds(){

var sURL =

" http://www.oddschecker.com/oddschecker/mode/o/card/m14099x/odds/559716x/sid

/ 520998";

document.getElementById(" odds")。innerHTML = sURL;

var oXML = new ActiveXObject(" Microsoft.XMLHTTP");

oXML.Open (GET,sURL,false);

oXML.send();

尝试{

var sXML = oXML.ResponseText;

sXML = sXML.replace(/< / g,"& lt;");

sXML = sXML.replace(/> / g, "& gt;");

document.getElementById(" odds")。innerHTML = sXML;

} catch(e){

提醒(失败!);

}

}

< / script>

< / head>

< body>

< input type =" button"值= QUOT;赔率" onclick ="赔率()>>

< hr>

< span id =" odds">< / span>
< hr>

< / form>

< / body>

< / html>



Will this help? Watch for word-wrap.

<html>
<head>
<title>oddschecker.htm</title>
<script type="text/javascript">
function Odds() {
var sURL =
"http://www.oddschecker.com/oddschecker/mode/o/card/m14099x/odds/559716x/sid
/520998";
document.getElementById("odds").innerHTML = sURL;
var oXML = new ActiveXObject("Microsoft.XMLHTTP");
oXML.Open("GET",sURL,false);
oXML.send();
try {
var sXML = oXML.ResponseText;
sXML = sXML.replace(/</g,"&lt;");
sXML = sXML.replace(/>/g,"&gt;");
document.getElementById("odds").innerHTML = sXML;
} catch(e) {
alert("Failed!");
}
}
</script>
</head>
<body>
<input type="button" value="Odds" onclick="Odds()">
<hr>
<span id="odds"></span>
<hr>
</form>
</body>
</html>


我尝试点击按钮,它只是说失败。 !!

会发生什么?它对你有用吗?


谢谢

Paul

I tried clicking on the button and it just said "failed" !!
What should happen ? Does it work for you ?

Thanks
Paul


" trower" ; < PA ********* @ mottmac.com>在消息中写道

news:11 ********************* @ f14g2000cwb.googlegro ups.com ...
"trower" <pa*********@mottmac.com> wrote in message
news:11*********************@f14g2000cwb.googlegro ups.com...
我试着点击按钮,它只是说失败。 !!
会发生什么?它对你有用吗?

谢谢
Paul
I tried clicking on the button and it just said "failed" !!
What should happen ? Does it work for you ?

Thanks
Paul




它对我有用。


尝试使用不同的URL进行测试。



It works for me.

Try it with a different URL to test it.


这篇关于如何在我的表单上获取另一个站点的源代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆