I'm try to compile python to exe with Pyinstaller and it's successful but exe programm not working.Nothing happens. Using modules: selenium and multiprocessing. When i run the script via python idle everything works as it should.
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.action_chains import ActionChains
from multiprocessing import Pool
import time
def start(url):
options = webdriver.ChromeOptions()
options.add_argument('headless')
options.add_argument('window-size=1920x935')
browser = webdriver.Chrome("chromedriver.exe", chrome_options = options)
wait = WebDriverWait(browser, 10)
browser.get(url)
browser.switch_to.window(browser.window_handles[-1])
wait.until(EC.visibility_of_element_located((By.XPATH, '//*
[@id="movie_player"]/div[33]/div[2]/div[1]/button'))).click()
wait.until(EC.visibility_of_element_located((By.XPATH, '//*
[@id="movie_player"]/div[33]/div[2]/div[1]/span/button'))).click()
time.sleep(180)
browser.quit()
if __name__ == '__main__':
links = open('links.txt', encoding = 'utf-8', errors='ignore')
urls = []
for i in links:
urls.append(i)
try:
p = Pool(processes = len(urls))
p.map(start, urls)
except Exception as e:
print(e)