Hello all, I have been stuck on a problem for quite some time. I am trying to post form data to a site that embeds forms within frames.

At the login page of safeway.com, there is a frame with a pzipcode form field that I want to post a zipcode to (in order to browse the online store).

The frame that contains the source I want is located at "https://shop.safeway.com/brands/swy/register/signin.asp?from=/superstore". I am currently trying to use WWW::Mechanize, but it fails to open the frame source.

#! /usr/bin/perl

use LWP 5.64;
use LWP::Simple;
use WWW::Mechanize;

my $browser = new WWW::Mechanize;
$browser->get('https://shop.safeway.com/brands/swy/register/signin.asp?from=/superstore');
$browser->success or die "Can't load frame";

$browser->submit_form(
form_number => 3, fields => {pzipcode=>$zipcode}
);

Does anyone know of a way I can get the frame source and then post a zipcode for the form in the embedded frame? Thanks in advance.

In reply to Submit form data embedded in frames using Perl by sdavis

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.