Python Forum
I have a problem saving the file in python
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
I have a problem saving the file in python
#1
I have a problem saving the file When it is finished, tell me it is finished and go see the LIVE.txt file I find it empty, even though it tells me it was saved ..

from selenium import webdriver
import time

live = open('LIVE.txt', 'w')
die = open('DIE.txt', 'w')
list = input("Input Mail List :")
while True:
    driver = webdriver.Chrome()
    driver.maximize_window()
    list = open(list, 'r').readlines()
    for line in list:
        email = line.strip()
        driver.get("https://www.etsy.com/forgot_password?email=")
        checkemail = driver.find_element_by_xpath('//*[@id="content"]/div/div/div/div[2]/form/div/input[1]')
        checkemail.send_keys(list)
        loginButton = driver.find_elements_by_css_selector("#submit-button")
        loginButton[0].click()
        emailcheck = driver.find_element_by_xpath('//*[@id="content"]/div/div/div/div[1]')

        if emailcheck == driver.find_element_by_xpath('//*[@id="content"]/div/div/div/div[1]') :
            print("\033[32;1mLIVE\033[0m | " + email + " | [(Checked)]")
            live.write(email + '\n')
        else:
            print("\033[31;1mDIE\033[0m | " + email + " | [(Checked)]")
            die.write(email + '\n')
Reply


Messages In This Thread
I have a problem saving the file in python - by abdlwafitahiri - Dec-26-2019, 03:34 PM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020