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 get a text of element #11

Closed
alufrew opened this issue Apr 24, 2020 · 4 comments
Closed

How get a text of element #11

alufrew opened this issue Apr 24, 2020 · 4 comments
Labels
question Questions related to rod

Comments

@alufrew
Copy link

alufrew commented Apr 24, 2020

I am trying to get text of element via: page.Element(selector).Text(). It returns empty string in my case.
If in browser I use document.getElementById("receipt-result").textContent I will get full text of element.
What method should I use in this case to get similar result?

@ysmood ysmood added the bug When you are sure about it's a bug label Apr 24, 2020
@ysmood
Copy link
Member

ysmood commented Apr 24, 2020

I recently fixed a bug of the Element.Text function, are you using the latest version of rod?

@ysmood ysmood removed the bug When you are sure about it's a bug label Apr 24, 2020
@ysmood
Copy link
Member

ysmood commented Apr 24, 2020

A temp solution can be something like this page.Element(sel).Eval("() => this.textContent")

@ysmood
Copy link
Member

ysmood commented Apr 24, 2020

Both work fine for me. Can you give me more info so that I can reproduce your issue?

@ysmood ysmood added the question Questions related to rod label Apr 24, 2020
@alufrew
Copy link
Author

alufrew commented Apr 25, 2020

Hi. Sorry for the long answer. Couldn't check it till now. It seems I was using 0.25.7 version of framework.
After update to 0.26.1 all works fine.

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

No branches or pull requests

2 participants