Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

Extract a value

52 views
Skip to first unread message

Gerhard Kreuzer

unread,
Aug 31, 2019, 5:21:44 AM8/31/19
to Selenium Users
Hi,
I used a simple way to extract the text from this WebItem:


I Need the values which were embedded in the 'font' tag, here the value is '(004)' for instance.

I just try FindElement(By.Id("border_currentpage")) and than use elem.Text.

After a Windows 10 update I totally lost connection to my browser, see other post. After installing the new verson of the EdgeDriver, this works for the first page, but on the second page it fails with an unknown error. As far as I can see, the source of the web page didn't change.

Maybe my method worked but is wrong and now it stops working. Can anybody tell me, is this method ok, and if not, how can I get the value correctly.

Thanks for helping.

With best regards

Gerhard

Влад Швайцер

unread,
Sep 3, 2019, 12:51:40 PM9/3/19
to Selenium Users
Hi Gerhard! 
If what you are trying to do is to get text from element then try please to get it from <td> element, because the <font> is just the settings of the text and it is probably wrong tag to get innerText from.
I'd recommend you to try use this :
driver.findElementByXpath("//font[@id='border_currentpage']//parent::nobr/.").getText();


суббота, 31 августа 2019 г., 12:21:44 UTC+3 пользователь Gerhard Kreuzer написал:

Gerhard Kreuzer

unread,
Sep 4, 2019, 6:03:04 PM9/4/19
to Selenium Users
Hi,
thanks for the answer, will try.
Unfortunately, after an update I only can use the .Text function once, than the WebDriver crashes .... This happens also when I try to get the text from some simple WebIren.

With best regards

Gerhard

Mike Hetzer

unread,
Sep 10, 2019, 4:36:15 PM9/10/19
to Selenium Users
Can you post the stacktrace of the error?

Seems like an odd issue - have you tested with other browsers?

Gerhard Kreuzer

unread,
Sep 11, 2019, 1:04:51 AM9/11/19
to Selenium Users
 Mike, I will try, but Needs some time cause I have to go to Hospital today ... sorry.
Reply all
Reply to author
Forward
0 new messages