From 9580d09b00fee2022279f90247d8567a416006ec Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Thu, 24 Jun 2010 16:34:17 -0400 Subject: [PATCH] Don't worry about sections that we can't lock --- sitecore.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/sitecore.py b/sitecore.py index 994f26b..6d864fd 100755 --- a/sitecore.py +++ b/sitecore.py @@ -33,6 +33,7 @@ import logging import time from selenium.firefox.webdriver import WebDriver +from selenium.common.exceptions import NoSuchElementException class SiteCoreConnection (object): @@ -176,7 +177,11 @@ def add_headshot_alt_tags(s): name = ' '.join([x.capitalize() for x in raw_name.split('_')]) s.logger.info('setting alt tag "%s" for %s' % (name, raw_name)) s.open_nav_section(raw_name) - s.lock_section() + try: + s.lock_section() + except NoSuchElementException, e: + s.logger.info("can't lock %s (already locked?), skipping" % raw_name) + continue alt_granddad,alt_tag = s.find_field('Alt:') alt_tag.clear() alt_tag.send_keys(name) -- 2.26.2