Jump to content

Jeremy

Membros
  • Contagem de Conteúdo

    1
  • Ingressou

  • Última visita

Postagens postado por Jeremy

  1. from subprocess import Popen
    from time import time
    from bs4 import BeautifulSoup as bsoup
    from selenium.webdriver import chrome, Chrome
    from selenium.webdriver.common.by import By
    from selenium.webdriver.common.keys import Keys
    from selenium.webdriver.support import expected_conditions
    from selenium.webdriver.support.ui import WebDriverWait

    OlostechPath = "../SaudeTech.exe"
    start = time()
    browser = Popen(['chrome', '--remote-debugging-port=9222'])
    chrome_options = chrome.options.Options()
    chrome_options.add_experimental_option("debuggerAddress", "127.0.0.1:9222")
    driver = Chrome(options=chrome_options)
    olos = Popen(OlostechPath)
    while(True):
        try:
            driver.switch_to.window(driver.window_handles[1])
            break
        except:
            pass
    driver.quit()
    olos.terminate()
    browser.terminate()
    print("Tempo de execução: {} segundos.".format(int(time()-start)))

     

    ---ERRO

    FileNotFoundError Traceback (most recent call last) <ipython-input-52-5581edf41f03> in <module> 10 OlostechPath = "../SaudeTech.exe" 11 start = time() ---> 12 browser = Popen(['chrome', '--remote-debugging-port=9222']) 13 chrome_options = chrome.options.Options() 14 chrome_options.add_experimental_option("debuggerAddress", "127.0.0.1:9222") ~\anaconda3\lib\subprocess.py in __init__(self, args, bufsize, executable, stdin, stdout, stderr, preexec_fn, close_fds, shell, cwd, env, universal_newlines, startupinfo, creationflags, restore_signals, start_new_session, pass_fds, encoding, errors, text) 852 encoding=encoding, errors=errors) 853 --> 854 self._execute_child(args, executable, preexec_fn, close_fds, 855 pass_fds, cwd, env, 856 startupinfo, creationflags, shell, ~\anaconda3\lib\subprocess.py in _execute_child(self, args, executable, preexec_fn, close_fds, pass_fds, cwd, env, startupinfo, creationflags, shell, p2cread, p2cwrite, c2pread, c2pwrite, errread, errwrite, unused_restore_signals, unused_start_new_session) 1305 # Start the process 1306 try: -> 1307 hp, ht, pid, tid = _winapi.CreateProcess(executable, args, 1308 # no special security 1309 None, None, FileNotFoundError: [WinError 2] O sistema não pode encontrar o arquivo especificado

     

×
×
  • Create New...