python - while循环可以用其他while循环打印小时吗?
问题描述
我有机器人女巫正在使用 selenium 为我实现自动化。我有柜台,但我也需要有日期,我的代码是:
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.action_chains import ActionChains
import time
import datetime
i = 1
actions = ActionChains(OMS)
now = datetime.datetime.now()
while i <= amount:
time.sleep(1)
bot.find_element_by_class_name('classname').click()
actions.send_keys("Lorem ipsum dolor sit amet, consectetlerisque." + Keys.RETURN)
actions.perform()
time.sleep(3)
print(i)
print(str(now))
i = i + 1
OMS.description(500)
**output:**
[1
2020 11 9 13 30 9
[2
2020 11 9 13 30 9
[3
2020 11 9 13 30 9
[4
2020 11 9 13 30 9...]
我的代码可以打印发送密钥的日期和时间吗?
解决方案
推荐阅读
- python-3.x - 尽管包含在 cmake 中,但仍缺少非免费的 opencv 算法
- python - Python:如果没有正确评估变量等于数字
- java - 你如何找到字符串中最大值和最小值的平均值?
- snowflake-cloud-data-platform - 如何从雪花连接器访问查询配置文件?
- jquery - JQuery Draggable 包含到父级和一些额外的
- python - 分布图中y轴的含义是什么?
- web3 - 为什么 web3 utils BN 不适用于数学?
- javascript - Flex滑块宽度缺陷问题
- python - 如何让 Atom 在终端 platformio-ide-terminal 中运行 Python3?
- python - 如何使用 tensorflow 以编程方式确定可用的 GPU 内存?