-
-
Notifications
You must be signed in to change notification settings - Fork 923
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
Are there any ways to find NodeId? #376
Comments
Actually, we need to find the position of parsed divs in HTML. It may be a line position or character position or even NodeId that can give us hints about the positions of parsed values. |
Hello Yiğit, AFAIK the nodeid is not a "thing" i.e. not a dom property or anything, it looks like it's just an incrementing ID that the Rust library assigns to each node in the tree? It doesn't exist as-is in goquery, but if the actual value is not important, just that it is unique, then if you store a reference of the internal node (the That being said, you also mention finding the position of elements in html, there's something I implemented a while ago in a branch that could give you what you want (or a good starting point), take a look at this issue and comment: #198 (comment) and the code is here: https://github.com/PuerkitoBio/goquery/blob/wip-selector/utilities.go#L21-L75 . Note that I don't remember how extensively it was tested, so use with care :) Hope this helps! |
Closing as it seems like that addressed your issue, feel free to re-open if there's more to discuss about this. |
While parsing HTML, we also need to find NodeId like scraper.rs library does in Rust:
Are there any way to find relevant NodeID info by using goquery?
The text was updated successfully, but these errors were encountered: