# Escaping special Characters when use 'Get Text' keyword

**URL:** <https://forum.robotframework.org/t/escaping-special-characters-when-use-get-text-keyword/4521>\
**Category:** SeleniumLibrary\
**Created:** [17 August 2022 08:06 UTC](https://forum.robotframework.org/t/escaping-special-characters-when-use-get-text-keyword/4521 "2022-08-17T08:06:34Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![hrnaltnts](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.robotframework.org/hrnaltnts/32/1220_2.png) [@hrnaltnts](https://forum.robotframework.org/u/hrnaltnts)\
**Post date:** [17 August 2022 08:06 UTC](https://forum.robotframework.org/t/escaping-special-characters-when-use-get-text-keyword/4521/1 "2022-08-17T08:06:34Z")

</div>

Hello  
I have been using the ‘Get Text’ keyword for simple assertation. But, sometimes text start with special characters like &,$… If I created manually I can use "" but in this case, the text comes from a web element. Then I set this result as a global variable.

I got this error message.

 ![image](https://europe1.discourse-cdn.com/flex005/uploads/robotframework1/original/2X/f/f7997eb729918a30c195c46e38b12e6e90f9000e.png)

```
Invalid dictionary variable item '${'selected_brand'}'. Items must use 'name=value' syntax or be dictionary variables themselves.

```

How can handle it?

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![HelioGuilherme66](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.robotframework.org/helioguilherme66/32/34_2.png) [@HelioGuilherme66](https://forum.robotframework.org/u/HelioGuilherme66)\
**Post date:** [17 August 2022 10:29 UTC](https://forum.robotframework.org/t/escaping-special-characters-when-use-get-text-keyword/4521/2 "2022-08-17T10:29:36Z")

</div>

You have an “error” in the variable name. Don’t use quotes.  
Name should be `${selected_brand}`.

You can use python string functions, to cleanup variables.

For example:  
`${selected_brand.strip('$','&')}`

---

<div class="post-metadata">

**Author:** ![hrnaltnts](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.robotframework.org/hrnaltnts/32/1220_2.png) [@hrnaltnts](https://forum.robotframework.org/u/hrnaltnts)\
**Post date:** [17 August 2022 15:04 UTC](https://forum.robotframework.org/t/escaping-special-characters-when-use-get-text-keyword/4521/3 "2022-08-17T15:04:24Z")

</div>

Thank you so much @HelioGuilherme66
