Click here to Skip to main content
15,178,422 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 19:00
professionalAdroittech9-Mar-16 19:00 
GeneralRe: Production reports from a test database - is this really best practice? Pin
rajni k9-Mar-16 20:01
professionalrajni k9-Mar-16 20:01 
GeneralRe: Production reports from a test database - is this really best practice? Pin
PIEBALDconsult10-Mar-16 6:59
professionalPIEBALDconsult10-Mar-16 6:59 
GeneralPowered by OSCommerce Pin
PIEBALDconsult2-Mar-16 18:02
professionalPIEBALDconsult2-Mar-16 18:02 
GeneralRe: Powered by OSCommerce Pin
RUs1232-Mar-16 23:31
MemberRUs1232-Mar-16 23:31 
GeneralRe: Powered by OSCommerce Pin
Bernhard Hiller3-Mar-16 22:10
MemberBernhard Hiller3-Mar-16 22:10 
GeneralRe: Powered by OSCommerce Pin
brunoha9-Mar-16 10:14
Memberbrunoha9-Mar-16 10:14 
GeneralOh, that ol' Cthulhu sure is sneaky... Pin
PIEBALDconsult17-Feb-16 11:42
professionalPIEBALDconsult17-Feb-16 11: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 14:10
professionalBrisingr Aerowing17-Feb-16 14:10 
GeneralRe: Oh, that ol' Cthulhu sure is sneaky... Pin
Chris Maunder17-Feb-16 16:43
cofounderChris Maunder17-Feb-16 16:43 
GeneralRe: Oh, that ol' Cthulhu sure is sneaky... Pin
Brisingr Aerowing18-Feb-16 18:46
professionalBrisingr Aerowing18-Feb-16 18:46 
GeneralRe: Oh, that ol' Cthulhu sure is sneaky... Pin
PIEBALDconsult26-Feb-16 9:19
professionalPIEBALDconsult26-Feb-16 9:19 
GeneralRe: Oh, that ol' Cthulhu sure is sneaky... Pin
Brisingr Aerowing26-Feb-16 19:06
professionalBrisingr Aerowing26-Feb-16 19:06 
GeneralRe: Oh, that ol' Cthulhu sure is sneaky... Pin
Chris Maunder17-Feb-16 16:45
cofounderChris Maunder17-Feb-16 16:45 
GeneralRe: Oh, that ol' Cthulhu sure is sneaky... Pin
V.17-Feb-16 20:53
professionalV.17-Feb-16 20:53 
GeneralRe: Oh, that ol' Cthulhu sure is sneaky... Pin
Ed Bouras22-Feb-16 3:59
MemberEd Bouras22-Feb-16 3:59 
GeneralRe: Oh, that ol' Cthulhu sure is sneaky... Pin
OriginalGriff18-Feb-16 5:13
mveOriginalGriff18-Feb-16 5:13 
GeneralIs this bad? Pin
James_Parsons17-Feb-16 3:07
MemberJames_Parsons17-Feb-16 3:07 
GeneralRe: Is this bad? Pin
Tim Carmichael17-Feb-16 3:31
MemberTim Carmichael17-Feb-16 3:31 
GeneralRe: Is this bad? Pin
Nish Nishant17-Feb-16 4:13
sitebuilderNish Nishant17-Feb-16 4:13 
GeneralStyle Guide for Obfuscation? Pin
Bernhard Hiller10-Feb-16 23:30
MemberBernhard Hiller10-Feb-16 23:30 
GeneralRe: Style Guide for Obfuscation? Pin
Richard Deeming11-Feb-16 2:23
mveRichard Deeming11-Feb-16 2:23 
GeneralRe: Style Guide for Obfuscation? Pin
Bernhard Hiller11-Feb-16 3:31
MemberBernhard Hiller11-Feb-16 3:31 
GeneralRe: Style Guide for Obfuscation? Pin
Richard Deeming11-Feb-16 3:36
mveRichard Deeming11-Feb-16 3:36 
GeneralRe: Style Guide for Obfuscation? Pin
#realJSOP11-Feb-16 3:38
mva#realJSOP11-Feb-16 3: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.