简体   繁体   English

从我的网页打开另一个网页并阅读其内容/单击按钮等

[英]opening a different webpage from my webpage and reading its content /clicking buttons etc

I was just curious as how to do this. 我只是好奇如何做到这一点。

I want to open www.whatsmyip.com or something similar from my webpage. 我想打开www.whatsmyip.com或类似的网页。

Put an ip address in the textbox in that page. 在该页面的文本框中输入一个IP地址。

Click the button 点击按钮

And read the value (suppose a textbox). 并读取该值(假设有一个文本框)。

I want to achieve all this programatically without any human interaction. 我想以编程方式实现所有这些目标,而无需任何人工干预。

How is that possible? 那怎么可能?

The example you posted is not possible. 您发布的例子是不可能的。

You can't read the contents of a frame from another domain(though a subdomain or on the same domain is possible), this is a restriction known as the same-origin policy , put in place for security reasons. 您无法从另一个域读取帧的内容(尽管可以在子域或同一域中),这是出于安全原因而设置的称为同源策略的限制。

What If I could launch gmail.com and read your login name, what about your online banking site? 如果我可以启动gmail.com并读取您的登录名怎么办,那么您的网上银行网站呢? :) You can see how this would be quickly abused if allowed. :)您可以查看如何在允许的情况下快速滥用它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM