-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcrapfiller.py
52 lines (43 loc) · 1.67 KB
/
crapfiller.py
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
51
52
# This script is skeleton for filling scam sites with fake data
#
# Script based on https://github.com/billsplate/marktplaatsgekkie/blob/main/crapper.py
#
# Generated by Selenium IDE
import random
import string
import pytest
import time
import json
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.common.action_chains import ActionChains
from selenium.webdriver.support import expected_conditions
from selenium.webdriver.support.wait import WebDriverWait
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
firefox_options = webdriver.FirefoxOptions()
driver = webdriver.Remote(
command_executor='http://127.0.0.1:4444',
options=firefox_options
)
def crapGen(size=20, chars=string.ascii_uppercase + string.digits):
return ''.join(random.choice(chars) for _ in range(size))
def webInit():
driver.get("https://xxxx")
# Navigate to correct DOM-element..
# driver.find_element(By.ID, "give-value-of-login").click()
# dropdown = driver.find_element(By.ID, "give-value-of-login")
# dropdown.find_element(By.XPATH, "//option[. = 'ING']").click()
# driver.find_element(By.CSS_SELECTOR, "option:nth-child(2)").click()
# driver.find_element(By.CSS_SELECTOR, "#account-login-button > span").click()
def bsInserter(user, passwd):
driver.get("https://xxxx")
driver.find_element(By.ID, "login-username").send_keys(user)
driver.find_element(By.ID, "login-password").send_keys(passwd)
driver.find_element(By.ID, "loginButton").click()
webInit()
while True:
try:
bsInserter(crapGen(), crapGen())
except KeyboardInterrupt:
driver.quit()