本文整理汇总了Python中marionette_driver.marionette.Marionette.close方法的典型用法代码示例。如果您正苦于以下问题:Python Marionette.close方法的具体用法?Python Marionette.close怎么用?Python Marionette.close使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类marionette_driver.marionette.Marionette
的用法示例。
在下文中一共展示了Marionette.close方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Wait
# 需要导入模块: from marionette_driver.marionette import Marionette [as 别名]
# 或者: from marionette_driver.marionette.Marionette import close [as 别名]
try:
client.find_element(By.CSS_SELECTOR, 'dd button.reject').click()
# Reject the translation
time.sleep(1)
Wait(client).until(gp_success)
# If a replacing translation is set, submit it
if args.replace:
try:
client.find_element(By.CSS_SELECTOR, '.action.edit').click();
time.sleep(1)
client.find_element(By.CSS_SELECTOR, '.textareas').find_element(By.CSS_SELECTOR, '.foreign-text').clear()
client.find_element(By.CSS_SELECTOR, '.textareas').find_element(By.CSS_SELECTOR, '.foreign-text').send_keys(args.replace)
client.find_element(By.CSS_SELECTOR, 'button.ok').click()
Wait(client).until(gp_success)
j += 1
except:
print(str(i) + ' - Not possible submit new string on ' + client.find_element(By.CSS_SELECTOR, '.breadcrumb li:nth-child(3)').text)
except:
print(str(i) + ' - Not possible reject on ' + client.find_element(By.CSS_SELECTOR, '.breadcrumb li:nth-child(3)').text)
client.close()
client.switch_to_window(original_window)
# Repeat the process
# Force a logout
client.navigate("https://translate.wordpress.org/wp-login.php?action=logout")
print('Finished!')
if args.replace is None:
sendmessage('Finished Translate.WP.org bulk rejection', args.search + ' on ' + args.remove + ' with ' + str(i) + ' removals')
else:
sendmessage('Finished Translate.WP.org bulk rejection', args.search + ' on ' + args.remove + ' with ' + str(j) + ' replaces')