Python Forum

Full Version: python 3.x and selenium. Service unexpectedly exited
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hallo. I'll get
Error:
ERROR - Message: Service /usr/bin/safaridriver unexpectedly exited. Status code was: 1
, if I try to run open_hyperlink_1 function. Also, first and fourth element in cycle load correctly. When I try run function without cycle all links will be opened correctly
def open_hyperlink_1(inp, end = ''):
op_log = logging.getLogger("root.open_hyperlink_1")
op_log.debug('*' + 'some_site_name'+end + '*')
try:
    driver = webdriver.Safari()
    driver.get('some_site_name' + end)
    select =driver.find_element_by_xpath('//div[@class="outcomesBlock firstBlock"]//ul')
    link_text = select.get_attribute("outerHTML")
    op_log.info('link opened')
    op_log.info('loading bets')
    print('+')
    driver.close()
    del driver
except Exception as E:
    op_log.error(E)
    print('-')

for i in link:
    open_hyperlink_1(inp, i)