我试图让我的程序写一个字符串到一个文本框与for循环,但我似乎不能做到这一点
我试着用函数和不函数来做,我调试了它,仍然找不到问题
HTML格式:
<textarea class="challengeTextArea" rows="4"></textarea>
我尝试的内容(python):
challange = "Dear, dear! How queer it seems, Alice said to herself, Which way? Which way?, holding her hand in hand with Dinah, and saying Come up again, dear! I shall"
text_box = driver.find_element_by_xpath("//textarea[@class='challengeTextArea']")
for letter in challange:
print(letter)
text_box.send_keys(letter)
print("IM HERE")
我希望它写入文本文件,但当我在for循环中打印字母时,它只打印第一个字母,甚至不写
如果你找不到问题,请让我知道,我会给更多的块从我的代码
您可以使用^{} 或^{} 来填充
textarea
,即:输出:
相关问题 更多 >
编程相关推荐