Home | Community | Message Board

Everything Mushrooms
Please support our sponsors.

General Interest >> Science and Technology

Welcome to the Shroomery Message Board! You are experiencing a small sample of what the site has to offer. Please login or register to post messages and view our exclusive members-only content. You'll gain access to additional forums, file attachments, board customizations, encrypted private messages, and much more!

Jump to first unread post. Pages: 1
Did the Mushroom choose you?

Registered: 07/20/04
Posts: 406
Last seen: 8 months, 7 days
Having Trouble Logging into a web page with WWW::Mechanize
    #3584795 - 01/05/05 05:43 PM (13 years, 1 month ago)

I am trying to script a program to autologin for me with the following HTML code data. Although for some

reason I can not seem to be able to fill the password field properly with WWW::Mechanize. Is the some hidden

jewel of syntax structure I am not yet aware of? Any help concerning this issue would be much appreciated!

-Thanks in advance.


use WWW::Mechanize;
use WWW::Mechanize::FormFiller;

my $mech = WWW::Mechanize->new();
my $formfiller = WWW::Mechanize::FormFiller->new();

my $username = "user_name";
my $password = "password";
my $url = "http://www.myurl.com/default.aspx";

# Grab the home page, and click the login button to redirect to the correct page(HTML listed below).
$mech->click_button(number => 1);

# Set the username and password fields accordingly and submit.
$mech->set_visible( $username, [password => $password] ) ;

# Store new HTML content in a temporary file and open it for viewing.
$html = $mech->content();
open (OUT,">tmp.html");
print OUT $html;
close (OUT);


<body bgcolor="#FFFFFF">
<form id="frmLogin" name="frmLogin" method="post" action="Login.aspx?__ufps=933290">
<input type="hidden" name="__VIEWSTATE"

<input type="hidden" name="__EVENTTARGET" value="">
<input type="hidden" name="__EVENTARGUMENT" value="">
<script language=javascript><!--
function __doPostBack(target, argument){
var theform = document.frmLogin
theform.__EVENTTARGET.value = target
theform.__EVENTARGUMENT.value = argument
// -->
<font size="-1" color="Black">Authorized users, please enter your trading user ID and password:<br>
Please enter your user ID:<br>
<input name="txtUID" size="32"/><br>
Please enter your password:<br>
<input name="txtPWD" size="32" type="password"/><br>
<input name="cmdGo" type="image" src="Brand/00/go.gif" alt="Go"/><br>
<input name="cmdHomeFromfrmLogin" type="image" src="Brand/00/home.gif"



Master: Everyday change your clothes and eat your food and you will become enlightened.

Pupil: Master, I do not understand...

Master: If you don't understand, eat your food and change your clothes.

Post Extras: Print Post  Remind Me! Notify Moderator
Jump to top. Pages: 1

General Interest >> Science and Technology

Similar ThreadsPosterViewsRepliesLast post
* Antikythera Mechanism in the news veggie 1,075 3 12/01/06 06:13 PM
by DieCommie
* cool web search NewfoundFreedom 1,082 18 09/21/04 01:14 AM
by ChingChong
* Mechanism Of Hallucinogens' Effects Discovered Zaprabe 1,138 6 06/20/07 03:52 AM
by SmokenBabyJesus
* Having trouble with torrents and playing video Cognitive_Shift 762 13 04/10/09 11:08 PM
by DieCommie
* Lawmakers urge U.S. to keep control of Web World Spirit 1,113 12 10/26/05 05:52 AM
by Rustifer
* Amazing documentary on the Antikithera mechanism. koppie 1,764 6 08/01/08 12:34 AM
by delta9
* Web Designers.... Boom 905 8 05/05/07 10:03 PM
by Boom
* wanna get weirded out and like codes/puzzles or know about web programming? TheWay 2,219 9 12/15/06 06:45 PM
by TheWay

Extra information
You cannot start new topics / You cannot reply to topics
HTML is disabled / BBCode is enabled
Moderator: Lana, trendal, automan
634 topic views. 0 members, 3 guests and 3 web crawlers are browsing this forum.
[ Toggle Favorite | Print Topic | Stats ]
Search this thread:
Please support our sponsors.

Copyright 1997-2018 Mind Media. Some rights reserved.

Generated in 0.031 seconds spending 0.008 seconds on 18 queries.