This repository has been archived by the owner on Sep 19, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
alibot.py
58 lines (42 loc) · 1.78 KB
/
alibot.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
53
54
55
56
57
58
import random
import string
import time
from selenium import webdriver
from selenium.webdriver.common.action_chains import ActionChains
#Your chrome driver directory
PATH = "/home/ricardo/Documents/Programming/Python/Projects/aliscript/chromedriver"
#Device setup
mobile_emulation = { "deviceName": "Nexus 5" }
chrome_options = webdriver.ChromeOptions()
chrome_options.add_experimental_option("mobileEmulation", mobile_emulation)
def bot():
driver = webdriver.Chrome(PATH, desired_capabilities = chrome_options.to_capabilities())
#Your promotion
driver.get("https://a.aliexpress.com/_mqVbrUB")
driver.implicitly_wait(10)
slash_promotion_button = driver.find_element_by_class_name("am-button")
slash_promotion_button.click()
driver.implicitly_wait(10)
ActionChains(driver).move_to_element(slash_promotion_button).click(slash_promotion_button)
time.sleep(1)
account_link_button = driver.find_element_by_xpath('/html/body/div[5]/div[2]/div[2]/div/a')
account_link_button.click()
register_button = driver.find_element_by_class_name("fm-tabs-tab")
register_button.click()
#Fill form
email = ''.join(random.choice(string.ascii_letters) for x in range(15))
email_input = driver.find_element_by_xpath('//*[@id="root"]/div[2]/div[1]/div/div/div[3]/input')
email_input.click()
email_input.send_keys(email+"@gmail.com")
pass_input = driver.find_element_by_xpath('//*[@id="root"]/div[2]/div[1]/div/div/div[4]/input')
pass_input.click()
pass_input.send_keys(email)
complete_button = driver.find_element_by_xpath('//*[@id="root"]/div[2]/div[1]/div/div/button')
complete_button.click()
slash_button = driver.find_element_by_xpath('//*[@id="app"]/div/div[3]/div[4]/div/div/a')
slash.click()
time.sleep(3)
driver.close()
repeat = int(input("Number of accounts: "))
for i in range(repeat):
bot()