Properties being appended with letter A
PurpleDonkey858 opened this issue · 5 comments
This is a really excellent piece of work.
I'm having some trouble with the properties in both the .csv and .xlsx. No matter what I put in (even tried with escape characters) it appends the letter A to the trait description. For example:
[["Dog", "Male"], ["Cat", "Female"]]
I ensured the text encoding was UTF-8 as the Python script expects.
Any ideas?
Thanks
it's also the same with just
[["Dog", "Male"]]
Are you running MacOS or Linux? The problem is with the clear_text()
method. It sends a Ctrl
+A
or Command
+A
to delete the default text, so it may not work on other platforms besides Windows.
I'm running on Linux so that could well be the problem. Thanks
Replace the clear_text()
method with that and tell me if it works.
def clear_text(self, element) -> None:
"""Clear text from an input."""
self.clickable(element) # Click on the element then clear its text.
control = Keys.COMMAND if os.name == 'darwin' else Keys.CONTROL
webdriver.ActionChains(self.driver).key_down(control).perform()
webdriver.ActionChains(self.driver).send_keys('a').perform()
webdriver.ActionChains(self.driver).key_up(control).perform()
Keys.COMMAND
only works on MacOS. That's why the bot works on Windows (Keys.CONTROL) and MacOS but not on Linux because it tries to use a Mac key.
Apologies for the delay - that has fixed it. Thank You very much.