in reply to Login to website (uses JS, I think)

Win32::IE::Mechanize and Mozilla::Mechanize provide a similar interface, but use a JavaScript-aware back end.
  • Comment on Re: Login to website (uses JS, I think)

Replies are listed 'Best First'.
Re^2: Login to website (uses JS, I think)
by paxprobellum (Initiate) on May 19, 2010 at 01:12 UTC

    I was able to grab Win32-IEAutomation, and it will fill in the form for me. Unfortunately, I can't get it to submit the values! I think I've covered all my bases. Any other ideas, or is it just not gonna do it?

    use Win32::IEAutomation; my $ie = Win32::IEAutomation->new( visible => 1, maximize => 1); $ie->gotoURL('http://app001.us1.darkfallonline.com/sf/fwd'); $ie->getTextBox('name:', "username")->SetValue('username'); $ie->getTextBox('name:', "password")->SetValue('password'); my @alllinks = $ie->getAllLinks(); foreach $l (@alllinks) { $l->Click(); } my @allimages = $ie->getAllImages; foreach $i (@allimages) { $i->Click(); } my @alltables = $ie->getAllTables; foreach $t (@alltables) { $t->Click(); }
      I think I need to click on a cell in the table (there's only 1), but I can't use any of the methods on my table! For example, "rows" and "tableCells" return a "Can't locate object method..." error. Any ideas what the problem is?
      Unfortunately, I can't get it to submit the values!

      What line of your program do you think that should happen?

        Once the values are in, I click every element I can get ahold of (all links, images, and tables) with the Click() function. If one of those was the submit button, it would submit (presumably). Seems I'm missing it, and my guess is that I need to click a cell (not the whole table). Unfortunately, all of the functions to actually get ahold of the cell aren't functioning. /bang_head_on_wall