使用 POST 方法自动登录 HTML – 双击自动登录网站
已发表: 2014-03-08如果您想通过自动填写Username/Email
和Password
来登录网站怎么办?
好吧,有一个简单的解决方案。 此解决方案适用于在表单中包含登录名和密码字段的大量网站。
这是一个简单的登录页面 (Crunchify-LoginPage.html),我必须在其中提供电子邮件和密码。 关联。
为了让您自动填写above fields
,只需在您的桌面或方便的位置创建一个示例文件Crunchify.html
文件并将其放在下面的内容。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
< html > < head > < title > Crunchify Login Page < / title > <script> function loginForm ( ) { document . myform . submit ( ) ; document . myform . action = "https://crunchify.com/wp-content/uploads/code/Crunchify-LoginPage.html" ; } </script> <style type ="text/css"> body { background-image : url ( 'https://cdn.crunchify.com/bg.png' ) ; } </style> < / head > < body onload = "loginForm()" > < form action = "https://crunchify.com/wp-content/uploads/code/success.html" name = "myform" method = "post" > < input type = "password" name = "password" value = "mypassw@rd" > < input type = "submit" value = "Login" > < / form > < / body > < / html > |
就是这样。 只需double click
上面的文件,就可以了。
以下是内部将发生的情况:
- 当您打开
Crunchify.html
文件时,它将在内部打开您的专用页面Crunchify-LoginPage.html
- 在内部,它将传递您在 Crunchify.html 文件中提供的电子邮件和密码
- 提交后,您将进入
success.html
页面
这是非常基本的 HTML 技巧,但有时它可以为重复登录活动节省大量时间。
仅供参考:这是 Crunchify-LoginPage.html 页面源代码,这是我在此示例中经常使用的登录页面:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
< ! DOCTYPE html > < html lang = "en" > < head > < meta charset = "utf-8" > < meta http - equiv = "X-UA-Compatible" content = "IE=edge,chrome=1" > < title > Crunchify - Login Form Example < / title > <style type ="text/css"> body { background-image : url ( 'https://cdn.crunchify.com/bg.png' ) ; } </style> < / head > < body > < div align = "center" > < section class = "container" > < div class = "login" > < h1 > Crunchify Web App - Automatic HTML Login Demo Page < / h1 > < form name = "myform" action = "https://crunchify.com/wp-content/uploads/code/success.html" > < p > < input type = "text" name = "email" value = "" placeholder = "Email" > < / p > < p > < input type = "password" name = "password" value = "" placeholder = "Password" > < / p > < p class = "submit" > < input type = "submit" name = "submit" value = "Login" > < / p > < / form > < / div > < / section > < section class = "about" > < p class = "about-author" > © 2012 – 2016 < a href = "https://crunchify.com" target = "_blank" > Crunchify . com < / a > < / section > < / div > < / body > < / html > |
