import time
from selenium.firefox.webdriver import WebDriver
+from selenium.common.exceptions import NoSuchElementException
class SiteCoreConnection (object):
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)