尝试在 Python 中编写高质量的 selenium 脚本
Try to write quality selenium script in Python
我有一个包含超过 1000 条网站记录的 csv 文件 addresses.I 编写了一个 140 行的脚本,其中包含函数并尝试捕获 Selenium 中一些最流行的异常,但我仍然 运行诸如属性错误或验证码之类的问题我如何才能跳过这个问题和我的脚本直到该 csv 文件的末尾并提取数据我 need.I 使用 ActionChains 方法单击页脚中所需的 link 位置`
ActionChains(driver).move_to_element(contactpg()[1]).click().perform()`
Ps:当我 运行 脚本工作了一段时间后 运行 遇到了一些问题 pages.My 问题是 Selenium 是否有一些用于大列表的模式URL 个可以通过问题页面。
您可以按照以下示例代码处理错误:
try:
#something
except Exception as e:
if 'particular message' in str(e):
# Do the following
# if you don't want to stop for loop then just continue
continue
我有一个包含超过 1000 条网站记录的 csv 文件 addresses.I 编写了一个 140 行的脚本,其中包含函数并尝试捕获 Selenium 中一些最流行的异常,但我仍然 运行诸如属性错误或验证码之类的问题我如何才能跳过这个问题和我的脚本直到该 csv 文件的末尾并提取数据我 need.I 使用 ActionChains 方法单击页脚中所需的 link 位置`
ActionChains(driver).move_to_element(contactpg()[1]).click().perform()`
Ps:当我 运行 脚本工作了一段时间后 运行 遇到了一些问题 pages.My 问题是 Selenium 是否有一些用于大列表的模式URL 个可以通过问题页面。
您可以按照以下示例代码处理错误:
try:
#something
except Exception as e:
if 'particular message' in str(e):
# Do the following
# if you don't want to stop for loop then just continue
continue