Session nicht erstellt: Der Chromprozess starten nicht. /> Der Code, der diese Aufgabe ausführt: < /p>
import pickle
import time
import urllib.parse
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.chrome.service import Service
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from webdriver_manager.chrome import ChromeDriverManager
def run():
with open("messages.pkl", "rb") as file:
messages = pickle.load(file)
options = webdriver.ChromeOptions()
options.add_argument("--no-sandbox")
options.add_argument("--disable-dev-shm-usage")
options.add_argument(r"--user-data-dir=C:\Users\Urano\AppData\Local\Google\Chrome\User Data")
options.add_argument("--profile-directory=Default")
service = Service(ChromeDriverManager().install())
driver = webdriver.Chrome(service=service, options=options)
wait = WebDriverWait(driver, 30)
print("Abriendo WhatsApp Web...")
driver.get("https://web.whatsapp.com")
input("Escaneá el código QR y presioná ENTER cuando WhatsApp Web esté cargado...\n")
for phone, message in messages:
try:
print(f"\n
encoded_message = urllib.parse.quote(message)
url = f"https://web.whatsapp.com/send?phone={ph ... ed_message}"
driver.get(url)
print("
message_box = wait.until(
EC.presence_of_element_located((By.XPATH, '//div[@data-tab="10"]'))
)
print("
time.sleep(2)
message_box.send_keys(Keys.ENTER)
print(f"
time.sleep(3)
except Exception as e:
print(f"
continue
driver.quit()
print("\n
if __name__ == "__main__":
run()
< /code>
und meine Projektstruktur (vor dem Ausführen eines Pyinstaller -Befehls):
Projektstruktur < /p>
Alle Hilfe zum Ausführen des Pyinstallers zur Behebung dieses Problems wäre sehr geschätzt! < /p>