не става нещо
#!/usr/bin/env python3
from selenium import webdriver
options = webdriver.ChromeOptions()
options.add_argument('--headless')
options.add_argument('log-level=3')
options.add_experimental_option('excludeSwitches', ['enable-logging'])
chromedriver='/usr/bin/chromedriver'
driver = webdriver.Chrome(chromedriver,
chrome_options=options)
driver.get('
http://www.cez.bg/bg/e-uslugi/avarii-remonti.html')
driver.switch_to.frame(driver.find_elements_by_tag_name('iframe')[0])
driver.find_element_by_id('searchField').send_keys('Перник')
for element in driver.find_elements_by_class_name('ui-btn'):
# print(element.text)
if element.text.startswith('Перник'.upper()):
element.click()
status = driver.find_element_by_class_name('ui-body').text
print(status)
тово е грешката
Traceback (most recent call last):
File "./chez.py", line 14, in <module>
chrome_options=options)
File "/usr/local/lib/python3.5/dist-packages/selenium/webdriver/chrome/webdriver.py", line 81, in __init__
desired_capabilities=desired_capabilities)
File "/usr/local/lib/python3.5/dist-packages/selenium/webdriver/remote/webdriver.py", line 157, in __init__
self.start_session(capabilities, browser_profile)
File "/usr/local/lib/python3.5/dist-packages/selenium/webdriver/remote/webdriver.py", line 252, in start_session
response = self.execute(Command.NEW_SESSION, parameters)
File "/usr/local/lib/python3.5/dist-packages/selenium/webdriver/remote/webdriver.py", line 321, in execute
self.error_handler.check_response(response)
File "/usr/local/lib/python3.5/dist-packages/selenium/webdriver/remote/errorhandler.py", line 242, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: unknown error: Chrome failed to start: exited abnormally
(unknown error: DevToolsActivePort file doesn't exist)
(The process started from chrome location /usr/bin/chromium is no longer running, so ChromeDriver is assuming that Chrome has crashed.)
(Driver info: chromedriver=73.0.3683.75,platform=Linux 4.9.0-12-amd64 x86_64)