in reply to WWW::Mechanize and "Bad <select> tag 'input'"

Got an <input> inside a <select> perhaps? Or an unterminated <select>? I'd take a hard look at your input HTML - post it if you need help.

-sam

  • Comment on Re: WWW::Mechanize and "Bad <select> tag 'input'"

Replies are listed 'Best First'.
Re^2: WWW::Mechanize and "Bad <select> tag 'input'"
by talexb (Chancellor) on Mar 19, 2008 at 18:42 UTC

    It's pretty plain vanilla:

    <!doctype html public "-//w3c//dtd html 4.0 transitional//en"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-885 +9-1"> <meta name="Author" content="Some Guy"> <meta name="GENERATOR" content="Some Browser"> <title>Some title</title> </head> <body> <h1>Some heading</h1> <font size="1"><a href="http://somewhere">Somewhere</a></font> <br> <form action="somescript.pl" method="POST" name="somename"> Please enter a username.<br> <input type="hidden" name="referrer" value="html"> <input type="text" size="20" name="username"> <input type="submit" val +ue="Submit"> </form> </body> </html>

    Alex / talexb / Toronto

    "Groklaw is the open-source mentality applied to legal research" ~ Linus Torvalds

      Well that's just plain bizarre. I don't know how HTML::Form gets the idea that $tag should be "select" since you don't have a single <select> in your HTML. (The warning you're getting is inside a "if ($tag eq 'select')" block and does appear to be designed to detect invalid tags inside a <select> block.)

      What version of HTML::Form are you using, btw? The latest on CPAN has a similar line, but not exactly the same:

          warn("Bad <select> tag '$tag' in $base_uri\n") if $verbose;

      Is it possible that you're not getting the HTML you think you're getting? Maybe an auth system getting in the way or some other trickery?

      -sam

          What version of HTML::Form are you using, btw?

        Thanks for your persistence .. my version of HTML::Form is 1.49; I see CPAN has 1.054, which I presume is a few versions more recent.

          Is it possible that you're not getting the HTML you think you're getting? Maybe an auth system getting in the way or some other trickery?

        Good questions .. let me dump out the HTML I do get and confirm that's what I posted. Thanks again.

        Alex / talexb / Toronto

        "Groklaw is the open-source mentality applied to legal research" ~ Linus Torvalds

        Just checked -- by dumping out the contents of the page, as far as WWW::Mech is concerned -- and it's the same as the page that I pasted earlier. There is a timeout that happens after an hour, but my test logs on and immediately tries to get to the web page, so that's not happening here.

        I wonder if that warning will disappear if I disable warnings ..

        Alex / talexb / Toronto

        "Groklaw is the open-source mentality applied to legal research" ~ Linus Torvalds