Tom Hamilton Stubber Tom Hamilton Stubber - 21 days ago 6
Python Question

Selenium inserting <br> tags

I am trying out selenium at the moment and am using it to insert text into fields that are saved into a MySQL db. However, it seems to be adding a

<br>
tag at the end of the string.

For example, my line:

driver.find_element_by_id("griddescription").send_keys("Add item test Desc")


adds
Add item test Desc<br>
into the database.

Any ideas?

ANSWER:

I had forgotten to use the .clear() command first so the
<br>
tags were already there to begin with.

Answer

I wasn't .clear()-ing the field before I inserted the text so the data was going in after the already present

Comments