如何使用脚本登录到没有发布请求的网站

时间:2020-02-05 07:31:30

标签: javascript python unix curl

我尝试使用脚本登录网站。 (我的路由器http://192.168.0.1

该网站的外观如下:

<input class="text" id="userName" type="text" >
<input class="text" id="pcPassword" type="password">
<label id="loginBtn" class="loginBtn" onClick="PCSubWin()"/></label>
<script>
function PCSubWin(){ 
var username = $("userName").value;
var password = $("pcPassword").value;
check username and password here.....
}</script>

我做了一些研究以使用卷曲。似乎curl必须使用post请求,但是我没有找到任何请求。单击登录后,它将发出带有授权Cookie的获取请求http://192.168.0.1/userRpm/LoginRpm.htm?Save=Save。然后加载主页。

我想做的是登录此页面(http://192.168.0.1),然后使用脚本单击某些按钮。

我该怎么做?对python,javascript甚至unix shell命令有任何想法吗?

新更新:::

我发现我应该使用浏览器引擎来这样做 硒

我现在可以成功登录。但是页面都是动态的,它显示 请升级到版本4或更高版本的浏览器,以便您可以使用此设置工具

成功后我会更新。

0 个答案:

没有答案