This project has moved. For the latest updates, please go here.

htmldocument.GetElementById returns wrong node

in a page i have the following: <span name="abc"></span> . . . <div id="abc"></div> htmldocument.GetElementById("abc") is giving me the span element. How so?

Id #43594 | Release: None | Updated: Mar 22 at 10:51 AM by mmcossu | Created: Mar 22 at 10:51 AM by mmcossu

Security issues raised by audtor for MixedCodeDocument > StreamWriter

The code scan report said The function Save() in MixedCodeDocument.cs sometimes fails to release a system resource allocated by StreamWriter() on line 310 and line 321. I guess StreamWriter did not...

Id #43580 | Release: None | Updated: Feb 22 at 5:53 AM by onming268 | Created: Feb 22 at 5:53 AM by onming268

Question about the HtmlNodeCollection.FindFirst method

Hello, I have a question about the implementation of the FindFirst method from the HtmlNodeCollection class. Why has it been implemented with a "Contains" instead of an equality comparer? It coul...

Id #43572 | Release: None | Updated: Feb 8 at 11:42 PM by Fread | Created: Feb 8 at 11:42 PM by Fread

StackOverflowException

When trying to convert html to text where there are malformatted tags or missing close tags, Html Agility Pack fails with StackOverflowException. This occurs on "Load" method. Malformatted html can...

Id #43571 | Release: None | Updated: Feb 8 at 12:12 PM by vreis | Created: Feb 8 at 12:12 PM by vreis

Problem to read full HTML content in few URL

Hi, I have created a service to extract HTML data in C# application. It works very well but in few URL's the dynamic HTML content is not downloaded. This problem occurs on those URLs where some of ...

Id #43564 | Release: None | Updated: Jan 27 at 6:27 PM by ajaysaini07 | Created: Jan 27 at 6:27 PM by ajaysaini07

Cannot parse all li's out of list

See this SO issue: http://stackoverflow.com/questions/41689137/html-agility-pack-parsing-error# In a nutshell, only 4 results are returned for no apparent reason. I'm guessing there's some sort of...

Id #43561 | Release: None | Updated: Jan 17 at 6:28 AM by ItsAllOk | Created: Jan 17 at 4:51 AM by ItsAllOk

RemoveChild (keepGrandChildren) with em inside returns strange results

Here's a simple snippet which attempts to strip out the span element while keeping everything else: var document = new HtmlDocument(); document.LoadHtml("<div><span>a<em>b</em>c</sp...

Id #43552 | Release: None | Updated: Jan 10 at 10:23 AM by johnnyoshika | Created: Jan 6 at 2:48 PM by johnnyoshika

Don't fine SelectNodes in HTMLnode [C#]

Hello I want use HTML Agility Pack to etract direct link By a website. I try to make different tuto but SelectNodes doesn't exist in Htmlnodes it's the same thing for load. In a lot of tuto they...

Id #43534 | Release: None | Updated: Nov 24, 2016 at 12:33 PM by CoSoBo | Created: Nov 24, 2016 at 12:33 PM by CoSoBo

support.net core

The dependency HtmlAgilityPack 1.4.9.5 does not support framework .NETStandard,Version=v1.6.

Id #43530 | Release: None | Updated: Feb 21 at 1:48 AM by LHCGreg | Created: Nov 17, 2016 at 9:48 PM by spongman

LoadHtml throws StackOverflowException for HTML with big level of tag embedding

The LoadHtml() throws StackOverflowException when using an HTML with big level of embedding. With the HAP sources I can see that exception is being thrown because of recursion in HtmlNode.SetChang...

Id #43529 | Release: None | Updated: Dec 6, 2016 at 6:06 AM by karthikasok | Created: Nov 10, 2016 at 11:17 AM by ArtemSMishchenko

Breaking Change In 1.4.9.1, Makes Fizzler Cause Exception

Dear Devs, Method 'Descendants' throws an exception when using Fizzler (css selectors) with HAP. Somebody has created an issue on this on Fizzler's GitHub: https://github.com/atifaziz/Fizzler/is...

Id #43511 | Release: None | Updated: May 11 at 1:00 AM by spongman | Created: Oct 26, 2016 at 6:13 PM by jwbats

Upgrade to Windows 10 mobile

__Upgrade for free on Windows phone __

Id #43510 | Release: None | Updated: Oct 25, 2016 at 9:27 AM by nadech007 | Created: Oct 25, 2016 at 9:23 AM by nadech007

&nbps tag become a capital B attached to the end of a word

Id #43500 | Release: None | Updated: Oct 9, 2016 at 11:34 PM by Daoose | Created: Oct 9, 2016 at 11:34 PM by Daoose

1.4.9.5: SelectNodes causes NullReferenceException

This simple little code causes NullReferenceException: HtmlDocument doc = new HtmlDocument(); doc.LoadHtml("<a>Hello World!</a>"); foreach(HtmlNode link in doc.DocumentNode.SelectNodes("//img")) { ...

Id #43496 | Release: None | Updated: Jan 25 at 12:45 PM by bjarteao | Created: Sep 22, 2016 at 10:04 AM by galmok

Unicode Load vs LoadHTML

I have a file with the string "I’m still" (note "right single quote"). If i read the file using Load it is turned to a string of bytes (UTF-7). If I simple use File.ReadAllText without specifying t...

Id #43491 | Release: None | Updated: Sep 12, 2016 at 9:02 PM by BobFrankston | Created: Sep 12, 2016 at 9:02 PM by BobFrankston

-

-

Id #43488 | Release: None | Updated: Sep 6, 2016 at 11:43 AM by higosmaduros | Created: Sep 6, 2016 at 10:54 AM by higosmaduros

Slash not properly parsed in attribute names

When parsing the following string: <img\onerror="alert()" src="ok"> HAP understands: <img nerror="alert()" src="ok"> while broser do undersantd <img onerror="alert()" src="ok"> Is it possible to ...

Id #43483 | Release: None | Updated: Sep 30, 2016 at 9:06 PM by jsearles | Created: Aug 26, 2016 at 2:21 PM by ThomasPP

Wrong XPATH for <form><ul>

While trying to work with this HTML <div class="liste clearfix"> <form name="compare_products" id="compare_products" method="post" action="/compare_products"> <ul> ...

Id #43474 | Release: None | Updated: Aug 17, 2016 at 10:14 AM by Daoose | Created: Aug 17, 2016 at 10:14 AM by Daoose

HtmlNode.SelectNodes behaves strangely with "//..." selector

I'd expect node.SelectNodes("//div") to return all divs that are descendents of node. Instead, it returns all divs in the document. It is behaving as if node == document.DocumentNode. v...

Id #43472 | Release: None | Updated: Sep 1, 2016 at 8:53 AM by GreatBasil | Created: Aug 13, 2016 at 3:15 PM by c0da

Trouble parsing html

I'm trying to parse the html page "http://projectfreetv.us/internet/big-brother-canada/season-1.html" with the CssSelect of ".episode a" It only gives me the episode classes in the first table. We...

Id #43463 | Release: None | Updated: Jul 30, 2016 at 11:22 PM by actsof3000 | Created: Jul 30, 2016 at 11:22 PM by actsof3000

Suport for .NET Core / .NET Standard

Hi there, is there any support in the works for building against the .NET Standard framework (as opposed to the .NET 4.6.X ? There was a fork someone did that ran on the old DNX runtime... but now...

Id #43455 | Release: None | Updated: Feb 21 at 1:49 AM by LHCGreg | Created: Jul 21, 2016 at 9:17 PM by Marchy

*high* Can not pass "Windows App Certification Kit"

Currently project with referencing HtmlAgilityPack.v1.4.9.4 can not pass "Windows App Certification Kit" with error message Debug configuration test FAILED Debug configuration •Error Found: The d...

Id #43450 | Release: None | Updated: Jul 15, 2016 at 8:05 AM by kostix | Created: Jul 12, 2016 at 12:19 PM by kostix

HTML Agility Pack

I used HTML Agility pack to screen scrap a site with the login credentials but after the logging all I get is a message "You have to login to access this page". Is this a security issue? or any ot...

Id #43433 | Release: None | Updated: Jun 10, 2016 at 8:46 PM by rajis | Created: Jun 7, 2016 at 9:08 PM by rajis

HtmlAttributeCollection changes attributes names to lowercase

this should not be the default behavior, why change the value of the attribute. I know the html standard is that attribute names are case insensitive, but today there is modern frameworks like Ang...

Id #43432 | Release: None | Updated: Jun 3, 2016 at 5:37 AM by wesam | Created: Jun 3, 2016 at 5:37 AM by wesam

HtmlDocument: Constructor with parameter of html string

I have two questions Is there official repo on github? I found only outdated fork :( Can you add constuctor to HtmlDocument with parameter of html string and build it up using string? Or any st...

Id #43392 | Release: None | Updated: Apr 6, 2016 at 10:12 PM by tsmirnov | Created: Apr 6, 2016 at 10:12 PM by tsmirnov

Tag mixing *generates* invalid html

Try this program: using HtmlAgilityPack; using System; class Program { const string test = @" <html> <body> <span> <p>Foo</span></p> <p>Bar</p> </body></html>"; static void Main(string[] arg...

Id #43352 | Release: None | Updated: Mar 29, 2016 at 2:44 AM by Tyf0x | Created: Feb 12, 2016 at 3:16 PM by poizan42

Invalid assembly version in Nuget package 1.4.9

The versions of some dlls in the Nuget package are not correct. The Nuget package version is 1.4.9. Net20, Net40, Net40-client, Net45 have the dll of version 1.4.9 which is correct. NetCore45 h...

Id #43348 | Release: None | Updated: Feb 10, 2016 at 11:14 AM by tomasherceg | Created: Feb 10, 2016 at 11:14 AM by tomasherceg

Give more detail in Exception("Error downloading html") for Metro version of HtmlWeb

In the metro version of HtmlWeb.LoadFromWebAsync an exception is thrown if the loaded page's status is not 200. It would be really helpful if a custom exception was thrown in this case that includ...

Id #43341 | Release: None | Updated: Feb 3, 2016 at 12:37 PM by RichardGarside | Created: Feb 3, 2016 at 12:37 PM by RichardGarside

Mistake in charset detection with patch

Hi, In HTMLWeb.cs, in private HttpStatusCode Get(Uri uri, string method, string path, HtmlDocument doc, IWebProxy proxy, ICredentials creds) There is : ...

Id #43339 | Release: None | Updated: Feb 1, 2016 at 3:05 PM by charlelie | Created: Feb 1, 2016 at 3:03 PM by charlelie

LoadHtml adds non existing tbody element

How to prevent LoadHtml from adding tbody element to elements tree, when tbody doesnt exist in original html code.

Id #43330 | Release: None | Updated: Jan 21, 2016 at 7:32 PM by nerexis | Created: Jan 21, 2016 at 7:32 PM by nerexis

Not case correct, how to pull case correct

Hello When i go to view the node all the aspx controls are in lowercase. is there a way to get it in propercase? Example: var doc = new HtmlAgilityPack.HtmlDocument(); doc.OptionOutputOriginalCase...

Id #43329 | Release: None | Updated: Aug 19, 2016 at 10:05 PM by Radioman21 | Created: Jan 21, 2016 at 4:13 PM by scascalesp

HtmlNode.XPath Property CASE

Even when OptionOutputOriginalCase = True, the XPath property is still returned as ALL LOWER CASE. Since XPath expressions are Case Sensitive, this is incorrect. The XPath property should ONLY be...

Id #43326 | Release: None | Updated: Jan 15, 2016 at 6:42 PM by WardMD | Created: Jan 14, 2016 at 5:19 PM by WardMD

SelectNodes() returns null

If there are no matches for a given XPath that is fed to SelectNodes() the result is null. Not only is this incorrect, but this forces us to have to check to see if the resulting collection is nul...

Id #43298 | Release: None | Updated: Aug 31, 2016 at 9:23 AM by Poma | Created: Nov 24, 2015 at 3:33 PM by DrewCo

Can only get .OuterHtml once

If you retrieve document.DocumentNode.OuterHtml once, then manipulate the dom, then retrieve it again, nothing will be changed. It is as if the .OuterHtml property freezes after the first retriev...

Id #43265 | Release: None | Updated: Apr 18, 2016 at 5:14 PM by pzahra | Created: Oct 17, 2015 at 2:34 AM by parati99

problems to find multiple results

I have a website which has to div tags with attribute class="xyz". To find the div (and it's childs) I tried: var result = doc.DocumentNode.Descendants("div") .Where(d => d.Attributes.Contains("c...

Id #43259 | Release: None | Updated: Oct 13, 2015 at 8:01 AM by infoboter | Created: Oct 13, 2015 at 8:01 AM by infoboter

How to remove the extra characters

Can the Html Agility Pack to remove the extra characters who himself created? I'm talking about the "/r", "/n" and "/" and others. I do not want to clean the line each time from these tags.

Id #43250 | Release: None | Updated: Sep 25, 2015 at 7:44 PM by KriBetko | Created: Sep 25, 2015 at 7:44 PM by KriBetko

End tag does not mean a parse error?

I tried this and got "no errors": Note the first <p> tag does not have an ending tag! string htmlPuro = @"<p>Dear Sir / Madam, <p> <b>{NameSite}</b> (<a href=""{LinkSite}"">{LinkSite}</a...

Id #43246 | Release: None | Updated: Sep 22, 2015 at 7:26 PM by cassiodeveloper | Created: Sep 22, 2015 at 7:25 PM by cassiodeveloper

HtmlEntity.Entitize("fi"); throws exception

//HtmlEntity.cs string str = HtmlEntity._entityName[index2]; //throws exception if index2 is not present in _entityName

Id #43235 | Release: None | Updated: Sep 1, 2015 at 6:30 PM by adarshdch | Created: Sep 1, 2015 at 6:30 PM by adarshdch

OutOfMemoryException when Parsing malformed HTML

If you have a malformed HTML document where a starting tag doesn't match the ending tag, iterating through the html tree via SelectNodes cause an endless loop and terminate with an OutOfMemoryExcep...

Id #43229 | Release: None | Updated: Aug 26, 2015 at 6:49 PM by lutz_rosema | Created: Aug 25, 2015 at 2:46 PM by lutz_rosema

VS 2015 Unable to find package 'HtmlAgilityPack'

PM> Install-Package HtmlAgilityPack Install-Package : Unable to find package 'HtmlAgilityPack' At line:1 char:16 + Install-Package <<<< HtmlAgilityPack + CategoryInfo : NotSpecified: ...

Id #43218 | Release: None | Updated: Jan 15, 2016 at 6:45 PM by WardMD | Created: Aug 18, 2015 at 7:58 PM by SanterR

slash from end-of-tag is misparsed

For the following test code: <test> <ref attname=abc/> </test> If I examine attributes of ref tag, its attribute name is "attname" and value is "abc/". That slash should not get added to the val...

Id #43202 | Release: None | Updated: Jan 15, 2016 at 6:56 PM by WardMD | Created: Aug 5, 2015 at 9:51 PM by onty

GetAttributeValue returns "Login"

Hi, I am using HtmlAgilityPack for web scraping. But when i am trying to read the tag attribute values through nodes, it returns the value "Login" instead of actual value. (Even InnerHTML also retu...

Id #43184 | Release: None | Updated: Jul 20, 2015 at 7:26 AM by nivassv | Created: Jul 20, 2015 at 7:24 AM by nivassv

Incorrect processing <p> node

The HTMLAgilityPack incorrect processing following <p> node in the attached HTML document (please find html file attached to this report). The closing tag gets removed from the document after proce...

Id #43167 | Release: None | Updated: Jul 3, 2015 at 6:33 PM by MikeKS | Created: Jul 3, 2015 at 6:31 PM by MikeKS

NuGet package corrupted

HtmlAgilityPack.1.4.9 NuGet package has a bad file inside it: lib\sl3-wp_._ The file has 0 size and a suspicious name . Opening HtmlAgilityPack.1.4.9 package with NuGet Package Explorer produces an...

Id #43161 | Release: None | Updated: Jun 29, 2015 at 3:14 PM by dzhigo | Created: Jun 29, 2015 at 3:14 PM by dzhigo

Not compiling with .NET 2.0

Hi, I've added the .NET 2.0 DLL in my test project with .NET 4.5.2. It works. using HtmlAgilityPack; using System; using System.Collections.Generic; using System.Linq; using System.Text; namespac...

Id #43155 | Release: None | Updated: Jun 18, 2015 at 4:12 PM by nolme | Created: Jun 18, 2015 at 4:12 PM by nolme

SetID does not update attribue set

When assigning a value to node.Id the property calls SetId which correctly creates an Id attribute and adds it to the document NodesId dictionary via SetIdForNode, however it is never added to the ...

Id #43111 | Release: None | Updated: May 10, 2015 at 9:01 PM by Eleihun | Created: May 10, 2015 at 9:01 PM by Eleihun

ASP.Net 5

Hi It seems there is some issues with asp.net 5. I install the htmlagility pack from the nugget source. Some of methods has error so I can not build my project but it works when I try the view in b...

Id #35929 | Release: None | Updated: Apr 12, 2015 at 5:33 AM by mirshahreza | Created: Apr 12, 2015 at 5:33 AM by mirshahreza

Differing results returned using name and local-name()

I am experiencing differing results using Html Agility Pack when trying to match an attribute starting with a given value. Using the sample HTML below: <!DOCTYPE html> <html> <head> <title>Title</t...

Id #35920 | Release: None | Updated: Apr 2, 2015 at 10:03 AM by rrrr | Created: Apr 2, 2015 at 10:03 AM by rrrr

Html Agility Pack load become chaotic!!!

When i use firefox xpath tool work fine that the xpath " id('mainTable')/tbody[1]/tr/td/table/tbody/tr/td/table/tbody/tr/td[2]/a " returns six records. But when i use HTMLDocument to Load it, it ...

Id #35889 | Release: None | Updated: Mar 18, 2015 at 3:52 AM by nalutao | Created: Mar 18, 2015 at 3:52 AM by nalutao

How do I change authentication method?

I'm loading a website but it just returns this text 'You are not authorized to view this page. You do not have permission to view this directory or page using the credentials that you supplied be...

Id #35864 | Release: None | Updated: Feb 28, 2015 at 6:00 PM by bergie | Created: Feb 26, 2015 at 12:50 PM by VascoLSN

Multithread OutOfMemoryException when calling LoadHtml

Hi I'm getting 2 different out of memory exceptions that are coming up from the LoadHtml method in the HtmlDocument class. the 1st is: System.OutOfMemoryException was caught HResult=-214702488...

Id #35857 | Release: None | Updated: Feb 19, 2015 at 7:42 PM by bergie | Created: Feb 19, 2015 at 7:42 PM by bergie

Portable assemblies should be signed

I'm having trouble with a PCL project referencing the HAP portable libraries, then a .NET4.5 app referencing both. It was unable to load the assembly. I tracked it down, and when I signed the porta...

Id #35854 | Release: None | Updated: Jul 21, 2016 at 6:16 PM by tranb3r | Created: Feb 18, 2015 at 1:38 AM by jdluzen

HtmlNode.SelectNodes is missing in PCL

As the title says, HtmlNode.SelectNodes is missing in PCL. There may be others, I'm not sure.

Id #35851 | Release: None | Updated: Apr 23, 2015 at 1:50 PM by shamal7 | Created: Feb 17, 2015 at 12:47 AM by jdluzen

Elements are not checked if they are complete

string actual = @"<p>Test</p"; //missing ">" string expected = string.Empty; HtmlAgilityPack.HtmlDocument hd = new HtmlAgilityPack.HtmlDocument(); hd.LoadHtml(actual); hd.ParseErrors.Count(); // ...

Id #35849 | Release: None | Updated: Feb 16, 2015 at 11:04 AM by tsmike | Created: Feb 16, 2015 at 11:04 AM by tsmike

Don't find all childrens

Hi , Thanks for your Great tools. I see a problem when select tags by XPath . I test my code on about 15000 pages and see this problem just on 3 pages ! in these pages : http://codeforces.com/b...

Id #35812 | Release: None | Updated: Apr 23, 2015 at 10:52 AM by gixar | Created: Jan 26, 2015 at 5:48 PM by bluemmb

HtmlEntity.DeEntitize throwing KeyNotFoundException

We are using the HtmlAgilityPack version 1.4.9 from nuget and we are facing an issue when calling Entity.DeEntitze on text containing '&' char. We implemented a method thats clean all Html tags fr...

Id #35798 | Release: None | Updated: Feb 2 at 5:42 PM by taj707 | Created: Jan 16, 2015 at 4:23 PM by smartech

1.4.9 NuGet package is a broken zip file

I downloaded the latest version by url = https://www.nuget.org/api/v2/package/HtmlAgilityPack/1.4.9 The file has SHA1 = FA66A9DBE10E8CA93E1459F069B9799CBC854274 and it cannot be unzipped: l:\temp\g...

Id #35774 | Release: None | Updated: Mar 7, 2015 at 8:37 AM by brettmas | Created: Dec 29, 2014 at 1:55 PM by vaskir

[patch] HtmlEntity.DeEntitize fails on numeric entities > 0xFFFF

The method call HtmlEntity.DeEntitize fails to correctly decode HTML escapes whose numeric value is greater than 65535 (0xFFFF), which causes trouble with the Supplementary Multilingual Planes of U...

Id #35771 | Release: None | Updated: Jan 1, 2015 at 2:49 PM by RavuAlHemio | Created: Dec 26, 2014 at 5:58 PM by RavuAlHemio

[patch] HtmlEntity.DeEntitize fails on numeric entities > 0xFFFF

The method call HtmlEntity.DeEntitize fails to correctly decode HTML escapes whose numeric value is greater than 65535 (0xFFFF), which causes trouble with the Supplementary Multilingual Planes of U...

Id #35770 | Release: None | Updated: Jan 1, 2015 at 2:47 PM by RavuAlHemio | Created: Dec 26, 2014 at 5:58 PM by RavuAlHemio

[Issue]End-Tag Always Omitted

Hi, I am not sure, if this was already raised. ( If it is, I'm very sorry ). I'm having an issue with the HTML Agility Pack, every time I try to save the document, it always omits the end-tag whe...

Id #35757 | Release: None | Updated: Dec 22, 2014 at 3:29 AM by johnelliotsigua | Created: Dec 22, 2014 at 3:17 AM by johnelliotsigua

ReplaceChild not working in WinRT version

I'm trying to parse HTML and convert it to Markdown in a WinRT app, and I've got the following code foreach (var x in doc.DocumentNode.SelectNodes("//strong")) { ...

Id #35750 | Release: None | Updated: Dec 15, 2014 at 11:16 AM by roryok | Created: Dec 15, 2014 at 10:40 AM by roryok

HtmlNode.CreateNode(str) doesn't create node from whole text, only to first <br>

I have following string, and I want to create HtmlNode from it: str="Hello colleagues,<BR><BR>Can you pls do something, something...<BR>" When I call var node=HtmlNode.CreateNode(str); node ha...

Id #35690 | Release: None | Updated: Nov 17, 2014 at 9:22 AM by mretlenj | Created: Nov 17, 2014 at 9:22 AM by mretlenj

html5 doctype causes xmlns attribute to be added

Consider this example html skeleton and code snippet: <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> </head> <body> ...</body> </html> var doc = new HtmlDocument(); doc.Load("f...

Id #35666 | Release: None | Updated: Nov 10, 2014 at 2:03 PM by lutz_rosema | Created: Nov 10, 2014 at 2:03 PM by lutz_rosema

Render nested of XML to HTML table

Suppose we have some nested XML formatting how can I enable render nested of data to HTML table, using Key/Value pair of XML ? Can I use Agility pack to approach my target ?

Id #35648 | Release: None | Updated: Oct 29, 2014 at 7:27 AM by ariahp | Created: Oct 29, 2014 at 7:27 AM by ariahp

System.NullReferenceException when not referencing null values?

Error: An unhandled exception of type 'System.NullReferenceException' occurred in test.exe Additional information: Object reference not set to an instance of an object. Code: public static string...

Id #35628 | Release: None | Updated: Oct 17, 2014 at 5:26 PM by pbjtime | Created: Oct 17, 2014 at 8:37 AM by pbjtime

HtmlAgilityPack not working for new programs in VS2013

I was creating a new Windows Phone 8 app and when I went to reference HtmlAgilityPack, even after installing the Nuget package I keep being told that VS is unable to find a reference to both it, an...

Id #35594 | Release: None | Updated: Oct 5, 2014 at 8:59 PM by emmetmclaughlin | Created: Oct 5, 2014 at 8:45 PM by emmetmclaughlin

The <= and => parse error

if parse <td align="center">EG/Ambulatoria <= 90 días</td>the result in not the esperated

Id #35593 | Release: None | Updated: Oct 3, 2014 at 4:21 PM by arcos_adrian | Created: Oct 3, 2014 at 4:21 PM by arcos_adrian

TFS Build Error "File Contains Corrupted Data" on Nuget Package Restore

When adding the HTMLAgilityPack 1.4.9 everything builds and works locally just fine. Once I check in and build on my TFS server I receive the following errors: "nuget.targets: File Contains corrup...

Id #35551 | Release: None | Updated: Nov 21, 2014 at 12:23 PM by RobVesse | Created: Sep 17, 2014 at 12:58 PM by DamienM4194

StackOverflow when accessing the OuterHtml property.

When an HtmlNode is of NodeType Text, and an operation happens that changes the OuterHtml there's going to be a StackOverflow whenever the OuterHtml is accessed again. The reason is, in the HtmlTe...

Id #35461 | Release: None | Updated: Aug 14, 2014 at 5:43 PM by elendil326 | Created: Aug 14, 2014 at 2:36 AM by elendil326

HtmlNode glitch ?

Hey guys, I think its a small glitch. The option tag mus be have flag HtmlElementFlag.CanOverlap not empty. It can contain lets say country flag image and should be rendered all the times with clos...

Id #35321 | Release: None | Updated: Jun 24, 2014 at 6:17 PM by JBaltikauskas | Created: Jun 24, 2014 at 6:17 PM by JBaltikauskas

.LoadHtml method too slow on Azure Virtual Machine

Hi all! I have an issue with HAP moving my WinForms application from local laptop to Windows Azure Virtual Machine. Azure VM is more powerful than laptop, each CPU-bound operation completes faster ...

Id #35285 | Release: None | Updated: Jun 10, 2014 at 3:47 PM by ValeOFY | Created: Jun 10, 2014 at 3:47 PM by ValeOFY

XPathNodeIterator returning invalid Name value for attributes

It appears the when an xpath expression is evaluated to an attribute the LocalName of the navigator is set to the attribute name, but the Name value still is set to the name of the parent node. T...

Id #35273 | Release: None | Updated: Jun 4, 2014 at 6:12 PM by aarondh | Created: Jun 4, 2014 at 6:12 PM by aarondh

XPath Select Nodes Issue

Hi! I want to select all html nodes which contains a attribute started with 'on' e.g. onsubmit, onselect, onclick, etc. With the XPath Visualizer Tool v1.3.0.6 it works with this simple XPath exp...

Id #35264 | Release: None | Updated: Jan 14, 2015 at 10:04 AM by dejanberic | Created: Jun 1, 2014 at 8:30 PM by topster

Bug report

Hi, There is problem with your dll. Please check the following code and link . Note that script is uppercase and it doesn't parse the html.. http://habera.com/haber/Bagis-a-boyle-tepki-gosterdile...

Id #35195 | Release: None | Updated: May 6, 2014 at 3:01 PM by erkanertural | Created: May 6, 2014 at 3:01 PM by erkanertural

<a> tag is being ignored by HtmlAgilityPack

Hi there, I have a HTML document that I'm trying to parse using HTML Agility Pack. I then use the XPath Navigator to get the branches that I want to access, once the document is loaded in the DOM....

Id #35153 | Release: None | Updated: Feb 20, 2015 at 5:35 PM by bergie | Created: Apr 24, 2014 at 8:55 AM by jredimer

Fortify reports XML injection possibility

Hi! We started using fortify to scan our builds and the following "critical issue" came up: XML Injection (Input Validation and Representation, Data flow) On line 1612 of HtmlNode.cs, the method ...

Id #35147 | Release: None | Updated: Apr 23, 2014 at 8:19 AM by FrankyBoy | Created: Apr 23, 2014 at 8:19 AM by FrankyBoy

After installing packet it doesn't work

It seems like it works after installation but I cannot really do anything with it.. I also tried the regular agility pack with same results. using HtmlAgilityPack; HtmlDocument dokki = new HtmlDoc...

Id #35128 | Release: None | Updated: Apr 13, 2014 at 10:43 PM by tonis | Created: Apr 13, 2014 at 10:43 PM by tonis

Problem with encoding

Can you please make the support for iso-8859-2 encoding? This is essential for my projects where I use HAP.

Id #35087 | Release: None | Updated: Mar 31, 2014 at 12:27 AM by TonchiVZ | Created: Mar 31, 2014 at 12:27 AM by TonchiVZ

Recursive algorithms can result in stack overflows

I've rewritten .InnerText, .WriteTo() and .CloseNode() to use iterative rather than recursive algorithms to improve the stability of HAP when parsing untrusted code. I've attached the patch we're u...

Id #35060 | Release: None | Updated: Mar 21, 2014 at 12:28 AM by GarethHayter | Created: Mar 20, 2014 at 2:56 PM by Aaron_Maenpaa

Incorrect xpath parse

Hi, First, I would like to say that the tool is great! However, there is a webpage that HtmlAgilityPack is not finding the correct element when I give the xpath nor it is generating the correct xp...

Id #34973 | Release: None | Updated: Jun 18, 2014 at 1:55 PM by PG_LoLo | Created: Feb 11, 2014 at 9:49 PM by gustavoas

HtmlAgilityPack.HtmlDocument is not working some times.

HtmlAgilityPack.HtmlDocument is not working some times.

Id #34922 | Release: None | Updated: Jan 23, 2014 at 6:11 AM by rameshk14 | Created: Jan 23, 2014 at 6:11 AM by rameshk14

DocumentNode.OuterHtml and Comment nodes

I manually append a comment node (var comment = hdoc.CreateComment, hdoc - an instance of HtmlDocument class, aNode.AppendChild(comment)). Then I call hdoc.DocumentNode.OuterHtml to see the whole ...

Id #34908 | Release: None | Updated: Jan 17, 2014 at 9:57 AM by PrComm | Created: Jan 17, 2014 at 9:45 AM by PrComm

HtmlDocument output cannot be parsed as XML because of " -- " in a comment

Hi, I found an issue where I'm trying to parse an HTML document and load it to XElement. This specific HTML had a comment at the header that was going like this: <!-- Comment comment comment -- --...

Id #34841 | Release: None | Updated: Jan 4, 2014 at 10:48 PM by LidanHackmon | Created: Jan 4, 2014 at 10:44 PM by LidanHackmon

body node not parsed when head not closed

I have run across some situations when the head tag was not closed. In this case the parser does not detect the body, so it's missing from the HtmlDocument tree. Example <html> <head> <title>th...

Id #34711 | Release: None | Updated: Dec 9, 2013 at 6:23 PM by mohanbabu400 | Created: Dec 2, 2013 at 11:11 AM by MariusBancila

Incorrect Parsing of Malformed Html

The following Html causes it not to parse the body. Input Html: <html> <head><script type="text/javascript" src="xss.js" /></head><body><script>alert('XSS')</script></body></html> DocumentNode.De...

Id #34669 | Release: None | Updated: Dec 9, 2013 at 6:23 PM by mohanbabu400 | Created: Nov 21, 2013 at 10:31 AM by Mriswith

Detection encoding before loading of HTML

HtmlWeb class throws an exception when it can not detect the document encoding. After some investigation I decided not to use this class at all and wrote my own charset detector based on Mozilla ch...

Id #34628 | Release: None | Updated: Nov 8, 2013 at 2:17 PM by PrComm | Created: Nov 6, 2013 at 6:17 PM by PrComm

HtmlWeb Ignores Credentials

If you pass a NetworkCredential but not a WebProxy to the Load method, the credentials are ignored. To reproduce: var web = new HtmlWeb(); var credentials = new NetworkCredential(...); web.Load(ur...

Id #34607 | Release: None | Updated: Oct 29, 2013 at 3:23 PM by richarddeeming | Created: Oct 29, 2013 at 3:23 PM by richarddeeming

OuterXml bug?

Consider the following sample application: using System; using System.Xml; using System.Xml.XPath; using HtmlAgilityPack; class Program { static void Main(string[] args) { string ...

Id #34411 | Release: None | Updated: Aug 27, 2013 at 3:35 PM by AlexFilipovici | Created: Aug 27, 2013 at 3:35 PM by AlexFilipovici

LoadHtml(...) causes StackOverflowException

Hi, Using build 1.4.6.0 loading the attached HTML and requesting the inner text caused the code to throw a StackOverflowException. Example Code: HtmlAgilityPack.HtmlDocument doc = new HtmlAgility...

Id #34382 | Release: None | Updated: Nov 10, 2016 at 11:21 AM by ArtemSMishchenko | Created: Aug 19, 2013 at 3:49 PM by mcsig

Shift-JIS content not decoding properly

Shift-JIS content is not being decoded (properly or at all, not sure). Just try to download http://www.2chan.net/index2.html and you'll see. The encoding is properly detected as Shift-JIS, but it's...

Id #34381 | Release: None | Updated: Aug 16, 2013 at 9:05 PM by thany | Created: Aug 16, 2013 at 9:05 PM by thany

DocumentNode.OuterHtml cache not refreshing

If I read DocumentNode.OuterHtml, then make changes to the document, those changes aren't reflected in DocumentNode.OuterHtml. I would presume this is a caching issue, much like - http://htmlagilit...

Id #34366 | Release: None | Updated: Nov 15, 2013 at 2:19 PM by dwest21 | Created: Aug 14, 2013 at 4:18 AM by Snixtor

HtmlWeb::Load strips ending . (full stops or %2E)

When I have a URL ending with a '.' or ending with '%2E', then HtmlWeb::Load fails as it strips the ending dot(s). I cannot find a way around this, and it's a bit of a show-stopper at the moment.

Id #34304 | Release: None | Updated: Jul 26, 2013 at 7:03 PM by JonnyM | Created: Jul 26, 2013 at 7:03 PM by JonnyM

Run FxCop for next release

Strongly suggest running FxCop before the next release. I have 294 warnings, many of them need attention. Karl

Id #34281 | Release: None | Updated: Jul 22, 2013 at 10:16 PM by molenator | Created: Jul 22, 2013 at 10:16 PM by molenator

Not disposing unmanaged objects

Hi, I really like the work you've done. However, we are getting strange exceptions in our Outlook 2010 Add-In I'm using the library in. I noticed that don't dispose of unmanaged objects nor use ...

Id #34280 | Release: None | Updated: Mar 10 at 11:57 PM by Venom0218 | Created: Jul 22, 2013 at 9:51 PM by molenator

HtmlTextNode.Text returns HTML code, not text

I believe the property should return value of the text node not HTML code of text node. Currently the property returns HTML code - i.e entities are not expanded - e.g. it returns < instead of <. S...

Id #34256 | Release: None | Updated: Jul 15, 2013 at 4:26 PM by Dzonny | Created: Jul 15, 2013 at 4:26 PM by Dzonny

HttpWeb.Get(string, string) method issue

I wrote following code to download and save list of groups of my University: HtmlWeb webDoc = new HtmlWeb(); try { webDoc.Get(@"http://timetable.tusur.ru/faculties/rtf", @"F:\list.htm"); } cat...

Id #34222 | Release: None | Updated: Jul 2, 2013 at 11:21 AM by MooNDeaR | Created: Jul 2, 2013 at 11:21 AM by MooNDeaR

Attributes.Remove on Image Only Removes One, When There Are Two

I'm using HtmlAgilityPack in our project, so that I can display some Html from another of our systems. I ran across this issue in my unit testing, and posted to StackOverflow to verify that this is...

Id #34185 | Release: None | Updated: Jun 20, 2013 at 9:49 PM by Saintless | Created: Jun 20, 2013 at 9:49 PM by Saintless

convert a string with HTML tags with a properly formatted string

Hi, Can I convert a string with HTML tags with a properly formatted string? I mean <TR>Test</TR><TR>Test2</TR> Can this be, Test Test2

Id #34166 | Release: None | Updated: Jun 13, 2013 at 6:39 AM by amittongaonkar | Created: Jun 13, 2013 at 6:39 AM by amittongaonkar

HtmlEntity.DeEntitize throws KeyNotFoundException if there is an & in the text

Supposedly this is the fix... Modified line 774 of HtmlEntity.cs to check for key in dictionary: string entity = _entityName.ContainsKey(code) ? _entityName[code] as string ...

Id #34122 | Release: None | Updated: Feb 2 at 5:36 PM by taj707 | Created: May 31, 2013 at 7:36 PM by patoutthere

htmlDoc.DocumentNode.SelectNodes("//ul/div[@class='p-normal']")只能得到得一个

foreach (HtmlNode item in htmlDoc.DocumentNode.SelectNodes("//ul/div[@class='p-normal']")) { for (int j = 1; j < 31; j++) { ...

Id #34066 | Release: None | Updated: May 17, 2013 at 4:30 PM by zhouweiaccp | Created: May 17, 2013 at 4:27 PM by zhouweiaccp