本文整理匯總了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')