-
-
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
Is it possible to get text after html tag? #355
Comments
Not directly with a selector, but see #287 . |
@mna i think goquery cant separate that example code into 6 chucks, it just return one big whole chunk with all the text inside ; so .Contents().Each is useless for me |
What do you mean? Did you try the example in the issue I linked?
|
@mna please try not to wrap with parent div |
Just change the "div" selector (which obviously won't work) with "body". |
Okay thanks, I think i might manually add the tag around it |
Oh you don't have to, if all you have is the three spans, when parsed with the net/html parser, it will automatically add the html/head/body tags to make it a proper document (the Go html parser uses the same logic as the official html5 parser unsed in browsers, so it tries hard to "fix" documents to make them valid). When in doubt, you should print the full html document after the call to |
i want to get 1,2,3 out;
i tried with
doc.Contents().Each
it just return the whole text out at onceThe text was updated successfully, but these errors were encountered: