Click here to Skip to main content
15,880,854 members

The Weird and The Wonderful

   

The Weird and The Wonderful forum is a place to post Coding Horrors, Worst Practices, and the occasional flash of brilliance.

We all come across code that simply boggles the mind. Lazy kludges, embarrassing mistakes, horrid workarounds and developers just not quite getting it. And then somedays we come across - or write - the truly sublime.

Post your Best, your worst, and your most interesting. But please - no programming questions . This forum is purely for amusement and discussions on code snippets. All actual programming questions will be removed.

 
GeneralRe: Production reports from a test database - is this really best practice? Pin
Adroittech9-Mar-16 18:00
professionalAdroittech9-Mar-16 18:00 
GeneralRe: Production reports from a test database - is this really best practice? Pin
rajni k9-Mar-16 19:01
professionalrajni k9-Mar-16 19:01 
GeneralRe: Production reports from a test database - is this really best practice? Pin
PIEBALDconsult10-Mar-16 5:59
mvePIEBALDconsult10-Mar-16 5:59 
GeneralPowered by OSCommerce Pin
PIEBALDconsult2-Mar-16 17:02
mvePIEBALDconsult2-Mar-16 17:02 
GeneralRe: Powered by OSCommerce Pin
RUs1232-Mar-16 22:31
RUs1232-Mar-16 22:31 
GeneralRe: Powered by OSCommerce Pin
Bernhard Hiller3-Mar-16 21:10
Bernhard Hiller3-Mar-16 21:10 
GeneralRe: Powered by OSCommerce Pin
brunoha9-Mar-16 9:14
brunoha9-Mar-16 9:14 
GeneralOh, that ol' Cthulhu sure is sneaky... Pin
PIEBALDconsult17-Feb-16 10:42
mvePIEBALDconsult17-Feb-16 10:42 
But he won't catch me so easily. Cool | :cool:

I've passed along links to Parsing Html The Cthulhu Way[^] many times so I always have the issue in mind. I usually read HTML with an XmlDocument (when I can) or the WinForms WebBrowser control, and I've seen others recommending the HTML Agility Pack.

This week I received a bunch of large HTML files to scrape.
They're not well-formed XML -- no surprise there.
So I decided that this would be a good opportunity to try the HTML Agility Pack.
It was able to read a sample, but it complained about “Start tag <td> was not found” -- which was surprising.

The problem? Several elements like this:

HTML
<th style="width: 5%"><!-- rule --></td>


OMG | :OMG:

The WinForms WebBrowser control is also able to read it, but the two tools treat it slightly differently and my initial feeling is that the WebBrowser handles it a little better.


So, the next time you encounter a developer who insists on consuming HTML with RegEx, pass them a sample like that, sit back, and watch the fun. Badger | [badger,badger,badger,badger...]
GeneralRe: Oh, that ol' Cthulhu sure is sneaky... Pin
Brisingr Aerowing17-Feb-16 13:10
professionalBrisingr Aerowing17-Feb-16 13:10 
GeneralRe: Oh, that ol' Cthulhu sure is sneaky... Pin
Chris Maunder17-Feb-16 15:43
cofounderChris Maunder17-Feb-16 15:43 
GeneralRe: Oh, that ol' Cthulhu sure is sneaky... Pin
Brisingr Aerowing18-Feb-16 17:46
professionalBrisingr Aerowing18-Feb-16 17:46 
GeneralRe: Oh, that ol' Cthulhu sure is sneaky... Pin
PIEBALDconsult26-Feb-16 8:19
mvePIEBALDconsult26-Feb-16 8:19 
GeneralRe: Oh, that ol' Cthulhu sure is sneaky... Pin
Brisingr Aerowing26-Feb-16 18:06
professionalBrisingr Aerowing26-Feb-16 18:06 
GeneralRe: Oh, that ol' Cthulhu sure is sneaky... Pin
Chris Maunder17-Feb-16 15:45
cofounderChris Maunder17-Feb-16 15:45 
GeneralRe: Oh, that ol' Cthulhu sure is sneaky... Pin
V.17-Feb-16 19:53
professionalV.17-Feb-16 19:53 
GeneralRe: Oh, that ol' Cthulhu sure is sneaky... Pin
Middle Manager22-Feb-16 2:59
Middle Manager22-Feb-16 2:59 
GeneralRe: Oh, that ol' Cthulhu sure is sneaky... Pin
OriginalGriff18-Feb-16 4:13
mveOriginalGriff18-Feb-16 4:13 
GeneralIs this bad? Pin
James_Parsons17-Feb-16 2:07
James_Parsons17-Feb-16 2:07 
GeneralRe: Is this bad? Pin
Tim Carmichael17-Feb-16 2:31
Tim Carmichael17-Feb-16 2:31 
GeneralRe: Is this bad? Pin
Nish Nishant17-Feb-16 3:13
sitebuilderNish Nishant17-Feb-16 3:13 
GeneralStyle Guide for Obfuscation? Pin
Bernhard Hiller10-Feb-16 22:30
Bernhard Hiller10-Feb-16 22:30 
GeneralRe: Style Guide for Obfuscation? Pin
Richard Deeming11-Feb-16 1:23
mveRichard Deeming11-Feb-16 1:23 
GeneralRe: Style Guide for Obfuscation? Pin
Bernhard Hiller11-Feb-16 2:31
Bernhard Hiller11-Feb-16 2:31 
GeneralRe: Style Guide for Obfuscation? Pin
Richard Deeming11-Feb-16 2:36
mveRichard Deeming11-Feb-16 2:36 
GeneralRe: Style Guide for Obfuscation? PinPopular
#realJSOP11-Feb-16 2:38
mve#realJSOP11-Feb-16 2:38 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.