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: "
Comments
Post a Comment