Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

I was never unhappy. I was simply pointing out that your posted solution doesn't work. You provide no caveats for the input, you don't cater for all valid HTML. Fundamentally your code doesn't return what OP wants. They want the value of the src element, though you'd have had to have read the other responses in the thread to know that.

According to your response in the CB, I'm:

"acting like the problem can't be fixed, and that's a load of crap."

"basically saying my idea can't possibly be tweaked to work, so I should just use a parser, marto. The thing is, it can and was tweaked, and you're not as clever as you think."

"missing the point. I fixed the error, and as long as there's an ending iframe tag from now on, my code works. Shit, I guess I could make sure there's an ending iframe tag too and that would prevent infinite loops caused by invalid html."

I still think it's you who is missing the point. At no point did I suggest you couldn't write code to properly parse HTML from scratch. It'll take you a very long time to create your own parser for HTML which caters for all of it's foibles, with a convenient way to access/select each valid attribute and it's associated value, which is also well tested with many test cases.

I think perhaps the scope of the problem wasn't something you'd fully considered when posting, or jumping to conclusions regards my response. A vast amount of work goes into creating parsers for HTML/XML/whatever which address their requirements and shortfalls. The solution OP has chosen is well tested, and they now have access to a toolkit which makes it trivial to cater for changes in the input/source data. The goal is to write code which works well and is easy to maintain.

On a non technical note I honestly don't care what you think of me, however I ask that you take a step and think before acting when communicating online in places such as this. If you post something that has issues expect people to tell you about it. If you say something in the chatterbox and someone responds take the time to try and understand what they're saying. Of course you're free to disagree, but there's no need to be rude and jump to bizarre conclusions as to what others are saying or thinking. Few regulars here will intentionally give you bad advice.


In reply to Re^4: how to extract iframes from text by marto
in thread how to extract iframes from text by Anonymous Monk

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



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (5)
As of 2024-04-19 14:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found