We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Detect HTML Tags, Attributes and Attribute Values
Detect HTML Tags, Attributes and Attribute Values
Sort by
recency
|
132 Discussions
|
Please Login in order to post a comment
As a huge proponent of the DRY principle (Don't Repeat Yourself), the below is a way of running this script:
You can make the print_tagattrs methods part of the class, or not, up to you, but I think this is a fairly straightforward DRY implmentation. If you really wanted, you could one-line the last two lines to get:
Note: this reduces readibility.