-
-
Notifications
You must be signed in to change notification settings - Fork 377
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature request] Get element by ID #477
Comments
This comment was marked as spam.
This comment was marked as spam.
It's 2022 now and I don't know why you still don't have heard about such basic things like XPath queries. 😘 HAP has a function for XPath queries: https://html-agility-pack.net/select-nodes XPath queries can be used to find/select nodes in a HTML (or XML) document by a variety of criteria, like for example to find element(s) with an id attribute having a certain value. For example, if you want to find any kind of element with an id "foobar", you could use the XPath query (I am not affiliated in any way with the HAP project. Just a user using the library in a couple of my projects...) |
Sorry, I'm really not very familiar with XPath. |
In case it got missed what i wrote at the end of my last comment: I am not representing the HAP project. I am not affiliated with the HAP project in any way. Looking around a bit in the code base of HAP, its HtmlDocument class already has a GetElementById method: html-agility-pack/src/HtmlAgilityPack.Shared/HtmlDocument.cs Lines 659 to 664 in c515e20
For reasons unknown to me, it's not appearing in the online documentation as far as i can tell. But then again, there is no real online API documentation of most of HAP's functionality anyway, so i guess it's par for the course with respect to HAP's documentation... 😕 |
Then this issue becomes to add the documentation … |
True. |
It's 2022 now and I don't know why you still don't have such a basic function: directly search an element by its ID, instead of having to know its actual path.
If you already have such a function then forgive me for not finding the relevant instructions in your documentation.
The text was updated successfully, but these errors were encountered: