c# - Html Agility Pack is truncating a meta tag's value -


i using html agility pack parse html , having issue poorly formatted meta tag.

given meta tag:

"<meta name=\"productattributes\" value=\"shop: baby|category: category|category: babies\" r\"us=\"\" exclusives|family:=\"\" strollers|name:=\"\" baby=\"\" trend=\"\" expedition=\"\" elx=\"\" travel=\"\" system=\"\" stroller=\"\" -=\"\" everglade|price:=\"\" 239.99\"=\"\">"  

when call:

htmlnode productattributes = hap.documentnode.selectsinglenode("//meta[@name='productattributes']");  var productattributesstr = productattributes.getattributevalue("value", ""); 

the resulting productattributesstr ending value truncated @ \”r”:

"shop: baby|category: category|category: babies"

what doing wrong?

you using " data inside attribute value delimited same character. first 1 hits ends attribute value. need represent them using entities: &quot;


Comments

Popular posts from this blog

c# - SharpSVN - How to get the previous revision? -

c++ - Is it possible to compile a VST on linux? -

url - Querystring manipulation of email Address in PHP -