diff --git a/ppparis.py b/ppparis.py index 4c5b14205b7b84afc1f88420d9bea7263bd533fa..5be54b19f895bb9b97e09883fdd39682610ce499 100755 --- a/ppparis.py +++ b/ppparis.py @@ -30,13 +30,6 @@ def print_output(data): f.write(data+"\n") f.close() -def start_display(): - display = Display(visible=False, size=(1024, 768)) - display.start() - -def stop_display(): - display.stop() - def get_html(url): browser.get(url) time.sleep(__WAITING_TIME) @@ -120,7 +113,8 @@ webdriver_options.add_experimental_option("prefs",prefs) if __headless_mode: webdriver_options.add_argument("--headless") webdriver_options.add_argument("--window-size=1024,768") - start_display() + display = Display(visible=False, size=(1024, 768)) + display.start() else: webdriver_options.add_argument("--start-maximized") @@ -167,4 +161,4 @@ for a in soup.find_all('a', href=True): # On arrête le navigateur browser.quit() if __headless_mode: - stop_display() \ No newline at end of file + display.stop()