# How to get value from UI?

**URL:** <https://forum.robotframework.org/t/how-to-get-value-from-ui/5085>\
**Category:** Robot Framework\
**Created:** [19 December 2022 13:49 UTC](https://forum.robotframework.org/t/how-to-get-value-from-ui/5085 "2022-12-19T13:49:03Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![rahul12](https://avatars.discourse-cdn.com/v4/letter/r/e9c0ed/32.png) [@rahul12](https://forum.robotframework.org/u/rahul12)\
**Post date:** [19 December 2022 13:49 UTC](https://forum.robotframework.org/t/how-to-get-value-from-ui/5085/1 "2022-12-19T13:49:03Z")

</div>

Hi  
I am new at Robot framework  
I want to fetch one number from ui  
in html  
\<h count (1234) \>h

code  
${count} = Get Text ${loc\_count}  
Log To Console ${count}  
but in log i get count = 0

---

<div class="post-metadata">

**Author:** ![damies13](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.robotframework.org/damies13/32/623_2.png) [@damies13](https://forum.robotframework.org/u/damies13)\
**Post date:** [19 December 2022 14:16 UTC](https://forum.robotframework.org/t/how-to-get-value-from-ui/5085/2 "2022-12-19T14:16:11Z")

</div>

Hi Pratik,

This doesn’t look like valid html? are you sure this is what it looks like (screen shot of the html in dev tools?)

```python
<h count (1234) >h

```

Perhaps it looks like this?

```python
<h count="1234"></h>

```

Or this?

```python
<h attributename="count(1234)"></h>

```

The next part to your question, you didn’t mention which library you are using? SeleniumLibrary or Browser Library?

Either way, `Get Text` is for getting the text content of the html not the attribute text, consider the example below:

```python
<div id="acb123" value="my special value">My Example Text</div>

```

If you wanted the text `My Example Text` you would use `Get Text`, but if you wanted `my special value` or `acb123`, then you need to get the attribute not the text, with either [Get Element Attribute](https://robotframework.org/SeleniumLibrary/SeleniumLibrary.html#Get%20Element%20Attribute) or [Get Attribute](https://marketsquare.github.io/robotframework-browser/Browser.html?tag=BrowserControl#Get%20Attribute) depending on which library you are using.

If getting the attribute then gave you back a string like `count(1234)` you would then need to further process it with something like [Get Substring](http://robotframework.org/robotframework/latest/libraries/String.html#Get%20Substring) or one of the other keywords from String Library.

Hope that helps,

Dave.
