Hello stackoverflow users. Today i want to ask for your help with something what is only a small part of my project. So... I have already done small application using Selenium to get text from div, text is not static, it changes with the character moves. Let me show:
botloc = driver.find_element_by_id('botloc').text
print botloc
I already looped it, so i can get update every 0,5sec (character moves 1 square within half a second). Of course i know its better to bind with key, but loop works fine for me when its in testing phase.
[example] Output of one botloc looks like that:
26,20
This is x and y from actuall position, so I want to use that comma like a separator to separate x and y, then i can assign each of them to single name(def, class, whatever).
[example]Output of 5 x botloc when I move my character looks like that:
28,20
28,21
28,22
29,22
30,22
So basically, it's all about square map, but i dont know the idea how to use that, so i created my own idea with simple logic and mathematics.
I am also trying to understand information from here: http://docs.python.org/2/tutorial/inputoutput.html but for now I wants to do homework is described above.
I was trying to use:
firstpart, secondpart = botloc[:len(botloc)/2], botloc[len(botloc)/2:]
But after including it to my code my botloc
is not working (no error, no text, just white), and the separator too, is any possibility to fix that?
Thanks for your understanding for me-new python learner!