Python Forum
python 3.x and selenium. Service unexpectedly exited - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: Web Scraping & Web Development (https://python-forum.io/forum-13.html)
+--- Thread: python 3.x and selenium. Service unexpectedly exited (/thread-4383.html)



python 3.x and selenium. Service unexpectedly exited - volkoshkursk - Aug-12-2017

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)