Tom Hamilton Stubber Tom Hamilton Stubber - 1 year ago 61
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

tag at the end of the string.

For example, my line:

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

Add item test Desc<br>
into the database.

Any ideas?


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

Answer Source

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

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download