-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathcreateAccount.js
More file actions
42 lines (38 loc) · 2.04 KB
/
createAccount.js
File metadata and controls
42 lines (38 loc) · 2.04 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
const { Builder, By, Key, until } = require('selenium-webdriver');
const accountInfo = require('./accountInfoGenerator');
const verifiCode = require('./getCode');
const email = require('./createFakeMail');
const sleep = (waitTimeInMs) => new Promise(resolve => setTimeout(resolve, waitTimeInMs));
(async function fakeInstagramAccount() {
let browser = await new Builder().forBrowser('chrome').build();
try {
await browser.get("https://www.instagram.com/accounts/emailsignup/");
await sleep(5000);
let fakeMail = await email.getFakeMail()
await browser.findElement(By.name("emailOrPhone")).sendKeys(fakeMail, Key.RETURN);
await browser.findElement(By.name("fullName")).sendKeys(await accountInfo.generatingName(), Key.RETURN);
await browser.findElement(By.name("username")).sendKeys(await accountInfo.username(), Key.RETURN);
await sleep(3000);
await browser.findElement(By.name("password")).sendKeys("me47m47eaa", Key.RETURN);
await sleep(5000);
await browser.findElement(By.xpath("//*[@id='react-root']/section/main/div/article/div/div[1]/div/div[4]/div/div/span/span[1]/select/option[3]")).click();
await sleep(3000);
await browser.findElement(By.xpath("//*[@id='react-root']/section/main/div/article/div/div[1]/div/div[4]/div/div/span/span[2]/select/option[12]")).click();
await sleep(3000);
await browser.findElement(By.xpath("//*[@id='react-root']/section/main/div/article/div/div[1]/div/div[4]/div/div/span/span[3]/select/option[26]")).click();
await sleep(3000);
await browser.findElement(By.xpath("//*[@id='react-root']/section/main/div/article/div/div[1]/div/div[6]/button")).click();
await sleep(5000);
let fMail = fakeMail.split("@");
let mailName = fMail[0];
let domain = fMail[1];
let veriCode = await verifiCode.getInstCode(domain, mailName, browser);
console.log(veriCode);
sleep(2000);
await browser.findElement(By.name("email_confirmation_code")).sendKeys(veriCode, Key.RETURN);
} catch (e) {
console.log(e);
} finally {
// await browser.quit();
}
})();