Home | Community | Message Board

Out-Grow.com - Mushroom Growing Kits & Supplies
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: 10 months, 10 days
Having Trouble Logging into a web page with WWW::Mechanize
    #3584795 - 01/05/05 05:43 PM (13 years, 3 months 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
* Free Web Hosting chodamunky 824 9 06/20/04 04:22 AM
by Meat_Log_Smurf
* cool web search NewfoundFreedom 1,087 18 09/21/04 01:14 AM
by ChingChong
* URGENT: I need some help to find New Web-Host Natura 1,058 8 06/16/03 07:33 PM
by Natura
* *DELETED* Hefex78 786 5 10/24/03 01:02 AM
by windex
* User-side web hosting Drink_Punk_Soda 938 3 10/14/03 08:09 AM
by Seuss
* Web Hosting for small business. Penguin 763 3 12/16/02 07:29 AM
by Penguin
* Web hosting, what's the best deal/packages? Twirling 657 2 04/14/04 03:59 AM
by Anno
* linux file system troubles monoamine 807 7 05/22/04 03:55 AM
by AhronZombi

Extra information
You cannot start new topics / You cannot reply to topics
HTML is disabled / BBCode is enabled
Moderator: Lana, trendal, automan
638 topic views. 0 members, 2 guests and 0 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.026 seconds spending 0.006 seconds on 18 queries.