Skip to content
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

How to get <span> value #298

Closed
liusese opened this issue Jul 3, 2019 · 2 comments
Closed

How to get <span> value #298

liusese opened this issue Jul 3, 2019 · 2 comments

Comments

@liusese
Copy link

liusese commented Jul 3, 2019

image

Which method can get a element value?
s.Find("span").Text()[Html()] can not get any?

image

Uploading image.png…

@mna
Copy link
Member

mna commented Jul 3, 2019

Hello,

Looks like in your case doc.Find("#todayweek").Text() would do the trick. Using Find("span").Text() will get you the combined text of all spans in the document. Also, your document might not be properly formatted or the character set might not be utf-8 (it has to be).

If you can paste a simplified version of a working example of the code and html (text, not screen captures), I can try it out and point out what might be going on.

Martin

@mna mna closed this as completed Jul 13, 2019
@davidAg9
Copy link

davidAg9 commented Nov 7, 2022

I have an issue where the value I want to get isn't in the span tag but beside it
<span class="fas fa-user"></span> Published By <a href="mailto:ur@gctu.edu.gh"> University Relations Directorate<!--Henry Amoah--></a> | <span class="fas fa-calendar"> </span> Monday October 3, 2022 | <span class="fas fa-clock"></span> 2:27 pm

how do I go about writing it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants