我正在尝试连接两个字符串,我遇到的问题是当我连接时,文本转到下一行。我正在使用selenium import webdriver
。我的代码是:
randomNum = ""
tries = 0
while (tries < 5):
randomNum += str(random.randint(0, 9))
tries = tries + 1
input = driver.find_element_by_id('identifierId')
email = name + randomNum
input.send_keys(email)
print email
我也试过
randomNum = []
tries = 0
while (tries < 5):
randomNum.append(random.randint(0, 9))
tries = tries + 1
input = driver.find_element_by_id('identifierId')
email = name + "".join(str(num) for num in randomNum)
input.send_keys(email)
print email
但是当我print email
时,我的输出就像是
Indoana
16029
我不知道为什么会这样,我需要Indoana16029