简体   繁体   English

加载网页并提交表单

[英]Load a Webpage and submit the form present on it

I am trying to load a webpage in jquery eg gmail.com (can be any other site also) , and once the page is loaded i want to fill the username and password and want to click on submit button . 我正在尝试在jQuery中加载一个网页,例如gmail.com(也可以是任何其他网站),并且一旦该页面加载完毕,我想填写用户名和密码,然后单击“提交”按钮。

Once i reached to the inbox page , I want to delete all the spam messages with my jquery code. 到达收件箱页面后,我想用我的jquery代码删除所有垃圾邮件。

Is it possible to do that or any API is available to do the same. 是否有可能做到这一点,或者任何API都可以做到这一点。

I tried loading the url in the iframe but after that i was not able to set the values in text fields. 我尝试将网址加载到iframe中,但此后我无法在文本字段中设置值。

I also looked at the phantom.js , but didn't get much out of it. 我还查看了phantom.js ,但并没有从中得到很多。

I am just a novice to jquery and trying to learn it. 我只是jquery并尝试学习它的新手。

Any suggestions ? 有什么建议么 ?

Why would you want to do this with jQuery? 为什么要用jQuery做到这一点? If you're looking to programmatically make network requests, use a server-side language. 如果您希望以编程方式发出网络请求,请使用服务器端语言。

You may be interested in this: https://developers.google.com/gmail/ if you're trying to manipulate gmail programmatically. 您可能对此感兴趣: https : //developers.google.com/gmail/(如果您尝试以编程方式操作gmail)。

What you're doing sounds a lot like spammer, cracker practices, however. 但是,您正在做的事情听起来很像垃圾邮件发送者,骇客行为。

Look up curl, and learn how to make network requests from the command line or from a scripting language such as ruby, python, etc. 查找curl,并学习如何从命令行或脚本语言(如ruby,python等)发出网络请求。

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

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