Ticket #14 (closed defect: fixed)

Opened 2 years ago

Last modified 2 years ago

Tag parsing funky-ness, or how I learned to stop worrying and love the malformed tag

Reported by: taph20guru Owned by: somebody
Priority: trivial Milestone: 0.5
Component: component1 Version: 1.0
Keywords: Cc:

Description

You can debate if this is a defect or enhancement, either way my code no-worky.

<preface> So there I am writing up a nice little auto-login program that will connect to my favorite website and grab or throw data at the said website without me having to login manually. I get to the part where I pull the login page into Hpricot and figure out where the username and password fields are and where the mighty 'action' element points to in the form field. BUT - whomever wrote this website's HTML code must have been distracted and mis-typed the form tag! Alas Hpricot will not find it!! Sad days to follow... </preface>

Form tags looks like: <form name='loginForm' method='post' action='/units/a/login/1,13088,779-1,00.html'?URL=> (_GASP_... see the ?URL= crap at the end of the tag??! No wonder Hprocot finds no *real* form tag a moves on!)

Oh yes - I've tried the old :fixup_tags and even threw :xhtml_strict at it for good measure to see if that helps. No dice. I'm a-figurin' that it doesn't think the form tag even exists and therefore no fix-up love.

Can we find a way to love this ugly form tag for the way that it is? Do I have to take it to some form of XHTML therapy? Will that be covered by my heath insurance benefits? Will I ever find auto-login nirvana?!? Can the mighty _why reach down and grant up peace in this sick little world and save my lost soul!!?!?

Ok - if can't be fixed I'll live, but good heck there should be a way around it!

Change History

Changed 2 years ago by why

  • status changed from new to closed
  • version set to 1.0
  • resolution set to fixed
  • milestone set to 0.5

Hey, alright, thankyou for bringing this up! I was able to hack in a bunch more flexibility into the attribute parser. And while I'm almost positive that someone is going to come back and say this broke something else, well, I'm afraid that's just how it goes.

So, see changeset [57] and I've added test cases which match the HTML you've got.

Note: See TracTickets for help on using tickets.