Home | Community | Message Board


Shroom Supply
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
OfflineMXNR
Did the Mushroom choose you?
Male

Registered: 07/20/04
Posts: 406
Loc: MARS
Last seen: 6 months, 20 days
Having Trouble Logging into a web page with WWW::Mechanize
    #3584795 - 01/05/05 05:43 PM (11 years, 11 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.
_______________________________________________________________


#!usr/bin/perl

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->get($url);
$mech->click_button(number => 1);

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

# 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);
system("tmp.html");


_______________________________________________________________


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

value="aDxfX1A7QDw716znrKftnYTgo4csMTs+Oz6urRmZvy6aJZj20y+gGEkgSS1/NA==">
<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
theform.submit()
}
// -->
</script>
<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"

alt="Home"/></font></form></body></html>

_______________________________________________________________


--------------------
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,015 3 12/01/06 06:13 PM
by DieCommie
* cool web search NewfoundFreedom 1,024 18 09/21/04 01:14 AM
by ChingChong
* Mechanism Of Hallucinogens' Effects Discovered Zaprabe 1,114 6 06/20/07 03:52 AM
by SmokenBabyJesus
* Having trouble with torrents and playing video Cognitive_Shift 677 13 04/10/09 11:08 PM
by DieCommie
* Lawmakers urge U.S. to keep control of Web World Spirit 1,035 12 10/26/05 05:52 AM
by Rustifer
* Amazing documentary on the Antikithera mechanism. koppie 1,745 6 08/01/08 12:34 AM
by delta9
* Web Designers.... Boom 893 8 05/05/07 10:03 PM
by Boom
* wanna get weirded out and like codes/puzzles or know about web programming? TheWay 1,890 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, Diploid, automan
585 topic views. 0 members, 1 guests and 1 web crawlers are browsing this forum.
[ Toggle Favorite | Print Topic | Stats ]
Search this thread:
High Mountain Compost
Please support our sponsors.

Copyright 1997-2016 Mind Media. Some rights reserved.

Generated in 0.025 seconds spending 0.002 seconds on 13 queries.