Oct-07-2017, 01:32 PM
(Oct-07-2017, 06:34 AM)buran Wrote: if I get right you want to get random number to be used in the xpath.
>>> from random import randint >>> month = randint(1, 12) >>> my_xpath="//SELECT[@name='month']/option[@value='{:0>2}']" >>> my_xpath.format(month) "//SELECT[@name='month']/option[@value='12']"
Hi Buran, thanks for sharing the solution!
This is the only part that confuses me:
{:0>2}What does that do?