Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from selenium import webdriver
- from selenium.webdriver.common.by import By
- from selenium.webdriver.support.ui import WebDriverWait,Select
- from selenium.webdriver.support import expected_conditions as EC
- from selenium.webdriver.common.keys import Keys
- from os import system
- import sys
- import json
- import time
- komparify_email = 'ahbhalgami20@gmail.com'
- komparify_password = '##whitehat'
- komparify_number = '8306106925' ## Don't put Telenor number
- keyword = 'abhi'
- amazon_password = 'abc@123'
- website = 'rhyta.com'
- global driver
- global amount
- komparify_status = 0
- number = (sys.argv[1])
- email = keyword+str(number)+'@'+website
- num1 = str(number)[-1:]
- posix = 500*(int(num1)-1)
- posiy = 0
- if int(num1) > 3:
- posiy = 500
- posix = 500*(int(num1)-4)
- def amazon(email):
- global amount
- global driver
- driver = webdriver.Chrome()
- driver.set_window_size(500,500)
- driver.set_window_position(posix, posiy)
- usernameStr = email
- passwordStr = amazon_password
- driver.get('https://www.amazon.in/gp/payment/statement')
- username = driver.find_element_by_id('ap_email')
- username.send_keys(usernameStr)
- nextButton = driver.find_element_by_id('continue')
- nextButton.click()
- password = WebDriverWait(driver, 10).until(
- EC.presence_of_element_located((By.ID, 'ap_password')))
- password.send_keys(passwordStr)
- signInButton = driver.find_element_by_id('signInSubmit')
- signInButton.click()
- balance = WebDriverWait(driver, 10).until(
- EC.presence_of_element_located((By.CSS_SELECTOR, 'span.a-size-medium.gc-balance.a-text-bold')))
- balance = str(balance.text)
- balance = balance.split('.')
- balance = int(balance[0][0:])
- amount = str(balance)
- f = open('log.txt','a')
- f.write('\n\n')
- f.write(str(number)+' : '+str(amount))
- def komparify():
- global driver
- global amount
- WebDriverWait(driver, 10)
- driver.get('https://www.komparify.com/recharge?utm_source=top_bar#type=mobile')
- number = driver.find_element_by_id('recharge_param_number')
- #number.clear()
- number.send_keys(komparify_number)
- time.sleep(1)
- operator = Select(driver.find_element_by_xpath("//select[@name='recharge_param[operator]']"))
- operator.select_by_value('4')
- value = driver.find_element_by_id('recharge_param_value')
- if int(amount) < 34:
- value.send_keys(int(amount))
- else :
- value.send_keys(str(int(amount)-1))
- recharge_button = WebDriverWait(driver, 10).until(
- EC.visibility_of_element_located((By.CLASS_NAME, 'sort-recharge')))
- time.sleep(2)
- recharge_button.click()
- login_link = WebDriverWait(driver, 10).until(
- EC.visibility_of_element_located((By.XPATH, "//a[contains(text(),'Login')]")))
- login_link.click()
- email = WebDriverWait(driver, 10).until(
- EC.visibility_of_element_located((By.ID, 'user_email')))
- email.send_keys(komparify_email)
- password = WebDriverWait(driver, 10).until(
- EC.visibility_of_element_located((By.ID, 'login_user_password')))
- password.send_keys(komparify_password)
- signin =WebDriverWait(driver, 10).until(
- EC.visibility_of_element_located((By.XPATH, "//input[@name='commit'][@value='Log In']")))
- signin.click()
- abutton = WebDriverWait(driver, 10).until(
- EC.visibility_of_element_located((By.XPATH, "//a[@href='#'][@class='payment_type paymentoption amazonpay ']")))
- time.sleep(1)
- abutton.click()
- pay = WebDriverWait(driver, 10).until(
- EC.visibility_of_element_located((By.XPATH, "//button[@id='gotopayubutton'][@class='neworangebutton']")))
- pay.click()
- time.sleep(3)
- driver.execute_script("document.forms[0].submit()")
- time.sleep(7)
- driver.get('https://www.komparify.com/wallet')
- f = open('log.txt','a')
- f.write('\t --> komparify ')
- driver.close()
- def main(email):
- amazon(email)
- if int(amount) == 0:
- print('\n\n\t\t\t [!] Oops Thats Account is empty')
- else:
- komparify()
- main(email)
- exit()
Add Comment
Please, Sign In to add comment