如何从学校主页获取经过身份验证的数据?

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

我想从大学主页抓取我的经过身份验证的数据,并且没有API调用。

因此,我必须将id和密码等POST数据发送到服务器,但是如果没有单击登录按钮我就无法登录。

以下是我的大学主页代码。

<form action="./_login.php" method="post"  autocomplete = "off" onSubmit="return comp()" name="login"  >
                <!--<form action="https://hisnet.handong.edu/login/_login.php" method="post"  autocomplete = "off" onSubmit="return comp()" name="login"  >-->
                    <!-- E-mail¿¡ ÀÖ´Â ¸µÅ©¸¦ Ŭ¸¯ÇÏ¿© À̵¿ÇÏ´Â °æ¿ì, ÀúÀåµÇ´Â °ª 3°¡Áö -->
                <input type =hidden name ="part" value ="">
                    <input type =hidden name ="f_name" value ="">
                    <input type =hidden name ="agree" value =""> <!-- 2013.10.04 ÃÊ°ú±Ù¹« À̸ÞÀÏ¿¡¼­ °áÁ¦Ã¢À¸·Î ¹Ù·Î À̵¿ÇϱâÀ§ÇØ Ãß°¡ (±èÀÎŹ) -->

                    <table border="0" cellpadding="0" cellspacing="0" width="285">
                        <tr>
                            <td><img src="/2012_images/intro/logbox1.gif" /></td>
                        </tr>
                        <tr>
                            <td height="23" style="text-align:center; background-image:url(/2012_images/intro/logbox2.gif)">
                                <input type="radio" name="Language" value="Korean" checked>
                                <a href='#' onkeypress='checkKorean();'><font style='font-size:10pt;'>ÇѱÛ</font></a> &nbsp;
                                <input type="radio" name="Language" value="English">
                                <a href='#' onkeypress='checkEnglish();'><font style='font-size:10pt;'>English</font></a>
                            </td>
                        </tr>
                        <tr>
                            <td style="text-align:center; background-image:url(/2012_images/intro/logbox2.gif)">
                                <table border="0" cellpadding="0" cellspacing="0">
                                    <tr>
                                        <td>
                                            <table border="0" cellpadding="0" cellspacing="0">
                                                <tr>
                                                    <td><img src="/2012_images/intro/txt_id.gif" width="61" height="18" /></td>
                                                    <td><span style="">
                                                      <input type="text" style="color:#000000; height: 16px; width:138px;ime-mode:inactive" name="id" autocomplete="off" tabindex="1" placeholder="¾ÆÀ̵𸦠ÀÔ·ÂÇϽʽÿÀ."  value=""/>
                                                    </span></td>
                                                </tr>
                                                <tr>
                                                    <td height="6" colspan="2"></td>
                                                </tr>
                                                <tr>
                                                    <td><img src="/2012_images/intro/txt_pwd.gif" width="61" height="18" /></td>
                                                    <td><input type="password" style="color:#000000; height: 16px; width:138px;ime-mode:inactive" name="password" autocomplete="off" tabindex="1" placeholder="Æнº¿öµå¸¦ ÀÔ·ÂÇϽʽÿÀ."></td>
                                                </tr>
                                            </table>
                                        </td>
                                        <td style="padding-left:8px;"><input type="image" src="/2012_images/intro/btn_login.gif" /></td>
                                    </tr>
                                </table>
                            </td>
                        </tr>
                        <tr>
                            <td><img src="/2012_images/intro/logbox_line.gif" /></td>
                        </tr>
                        <tr>
                            <td style="text-align:center; background-image:url(/2012_images/intro/logbox2.gif); height:18px;">
                                <input type="checkbox" id="saveid" name="saveid" value="Y" /> ¾ÆÀ̵ðÀúÀå&nbsp;&nbsp;  <a onclick="UserLoginPopUp()" style="cursor:pointer"><font color="#FF0000"><!--<b>* HISNet ·Î±×ÀÎÀÌ ¾ÈµÉ °æ¿ì</b>--></font></a>
                            </td>
                        </tr>
                        <tr>
                            <td><img src="/2012_images/intro/logbox3.gif" /></td>
                        </tr>
                        <tr>
                            <td>&nbsp;</td>
                        </tr>
                        <tr>
                            <td><img src="/2012_images/intro/line_txt1_1.gif" border=0/><a href="/registration/regist_step1.php"><img src="/2012_images/intro/line_txt1_2.gif" border=0/></a></td>
                        </tr>
                        <tr>
                            <td><img src="/2012_images/intro/line_txt2_1.gif" border=0/><a href="javascript:findID();"><img src="/2012_images/intro/line_txt2_2.gif"  border=0/></a></td>
                        </tr>
                        <tr>
                            <td><img src="/2012_images/intro/line_txt3_1.gif" border=0/><a href="javascript:findPW();"><img src="/2012_images/intro/line_txt3_2.gif"  border=0/></a></td>
                        </tr>
                    </table>
                </form>

我是这样实现的。

main() async {

  http.post('http://hisnet.handong.edu/login/login.php',
  headers: {'Content-Type': 'application/x-www-form-urlencoded'},
  body: {'id':'myID','password':'myPassword'})
  .then((response){
    print('Response status: ${response.statusCode}');
    print('Response body: ${response.body}');
  });
}

但是,此实现仅填充表单而不单击登录按钮。在这种情况下,我想将我的数据发送到服务器。我怎样才能做到这一点?

post login dart flutter web-crawler
1个回答
0
投票

我相信这是你如何弄清楚信息。

步骤1,导航到登录页面。第2步,打开浏览器调试工具并选择网络

Image 1

第3步,失败或成功登录以获取帖子信息

enter image description here

URL: https://hisnet.handong.edu/login/_login.php
POST data:

part
f_name
agree
Language=Korean
id=sadasd
password=asdasd
x=25
y=26

curl 'https://hisnet.handong.edu/login/_login.php' -H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:65.0) Gecko/20100101 Firefox/65.0' -H 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8' -H 'Accept-Language: en-US,en;q=0.5' --compressed -H 'Referer: https://hisnet.handong.edu/login/login.php' -H 'Content-Type: application/x-www-form-urlencoded' -H 'DNT: 1' -H 'Connection: keep-alive' -H 'Cookie: PHPSESSID=vn4f2mksuv4lfo1i7co2c0e184; NSC_xfcqpsubm_WJQ=ffffffffc8f47f3e45525d5f4f58455e445a4a423660; NSC_ijtofu_ttm=ffffffffc8f47f2145525d5f4f58455e445a4a423660' -H 'Upgrade-Insecure-Requests: 1' --data 'part=&f_name=&agree=&Language=Korean&id=sadasd&password=asdasd&x=25&y=26'

有了所有这些信息,请创建您的登录信息

http.post(https://hisnet.handong.edu/login/_login.php, body: { "part" : null, "f_name" : null, "agree" : null, "Language": "Korean", "id": "sadasd", "password":"asdasd", "x": "25", "y":"26"})

老实说,我不明白所有这些字段的意思或成功的尝试,所以无论我是否应该发送一个int或字符串,我都无法验证。在最糟糕的情况下,您需要使用webbrowser

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