Open Ebola-Chan-bot opened 2 years ago
这是来自QQ邮箱的假期自动回复邮件。 您好,你的邮件已收到。 亮亮
It's 2022 now and I don't know why you still don't have heard about such basic things like XPath queries. :kissing_heart:
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 //*[@id='foobar']
.
(I am not affiliated in any way with the HAP project. Just a user using the library in a couple of my projects...)
It's 2022 now and I don't know why you still don't have heard about such basic XML-related 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 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
//*[@id='foobar']
.(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. But I have also investigated some of your well-known competing products, such as Aspose.HTML, AngleSharp, etc. They all straightforwardly provide the GetElementById function and do not require users to understand XPath. I believe HAP would be more attractive if this function is added, since you specified HTML, where the ID attribute is specially defined, instead of a more general XML in the package title.
some of your well-known competing products
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:
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... :confused:
some of your well-known competing products
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:
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 … Many people won't bother to download it if they can't find the function they want in the documentation, especially when there're many other options.
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.