使用Perl自动登录

时间:2012-12-30 16:48:29

标签: perl web https www-mechanize

我正在尝试编写一个登录我的Intex帐户的脚本。出于某种原因,我无法通过登录屏幕。我知道页面是https,我不确定我在考虑这种安全性方面做错了什么。在脚本结束时,作为测试,我尝试在chrome中启动页面。这只是让我回到登录界面。谢谢你的帮助。

use WWW::Mechanize;
use Crypt::SSLeay;
use HTTP::Cookies;
my $mech = WWW::Mechanize->new();
$mech->agent_alias( 'Windows IE 6' );
$mech->cookie_jar(HTTP::Cookies->new());

my $url = 'https://www.intex.com/main/login.php';
$mech->get( $url );

my $pass = 'example';

$mech->set_visible( $pass);
$mech->click;

#this is a test to see whether the next output is wrong
print $mech->text(); 

my $link = mech->uri();
system ('start chrome '.$link);

我现在正在使用www :: mechanize :: firefox并且上传表单有问题。谁能告诉我如何使用该模块将文件提交到这样的表单?

<form action="http://www.cs.tut.fi/cgi-bin/run/~jkorpela/echo.cgi"
enctype="multipart/form-data" method="post">
<p>
Type some text (if you like):<br>
<input type="text" name="textline" size="30">
</p>
<p>
Please specify a file, or a set of files:<br>
<input type="file" name="datafile" size="40">
</p>
<div>
<input type="submit" value="Send">
</div>
</form>    

编辑::我需要点击这样的按钮......

<B><FONT SIZE=2>Then click...</FONT></B><A HREF="Javascript:CheckPortfolioUpload('Portfolio - Select Portfolio - Upload ? Go ~ Results')"><IMG NAME=GoBtn SRC=/images/button/GreenGo.gif BORDER=0 TITLE='Upload'  CLASS=Clickable></IMG></A>
</TABLE>

我不知道该怎么做。

0 个答案:

没有答案
相关问题