3
Vote

Wrong Xpath if ana element is part of form

description

Hi, I found this package helpful for parsing html. But it is giving wrong xpath when the element is part of form. Any idea how to fix this?

comments

perryism wrote Dec 20, 2010 at 6:43 PM

I have the same problem too.

Given the source as the following. I expected I could retrieve the node using '/html/body/form/div[2]'. Instead, I could get the node by using '/html/body/div[2]'. Is it a bug? Can somebody please helps? Thanks

<html>

<body>
<form>
    <div></div>
    <div>Hello World</div>

</form>
</body>

</html>

perryism wrote Dec 20, 2010 at 7:46 PM

Hey CSharp DEV,

I digged into the source code and found something. I simply removed the line where it categorizes form tag as a tag not allowing other tags.