Add variable value to xpath

I am reading data from CSV file.
value is stored in !col1 variable.

how do I add it to xpath?
I want to locate that element.

I tried this but its not working




I fixed the code

I want to extract HTML code of this element.
Please help.

So you want to store the complete HTML code in a variable? Can you give an full example with a public website? Otherwise I do not understand what the goal is.

I want to get HTML code of a tag
for example

here I am clicking div tag using attribute ‘data-filter-email’.

I want to extract complete HTML code of this tag
starting with <Div and ending with /div>

you can take any example, take header of the topic “Add variable value to xpath”
I am new to so struggling as its my day 1.


I usually use variable in xpath and working like a charm

Probably you used a wrong xpath, try to detect better xpath


single quotes were missing.

Now I want to extract HTML code of the element.