· 6 years ago · Nov 25, 2019, 05:10 PM
1from selenium import webdriver
2import time
3
4url = 'https://socialrocket.in/'
5driver = webdriver.Chrome('chromedriver.exe')
6
7driver.get(url)
8driver.maximize_window()
9
10time.sleep(3)
11
12for i in range(1,100):
13 name_field = driver.find_element_by_css_selector('#gatsby-focus-wrapper > div > section.index-module--section--20zZC.index-module--hasBackgroundSecondary--2s7kJ.index-module--has-text-centered--3XPnf > div > div > div:nth-child(1) > form > div:nth-child(2) > div > input')
14 name_field.send_keys('spam' + str(i) + ' lul' + str(100-i))
15
16 email_field = driver.find_element_by_css_selector('#gatsby-focus-wrapper > div > section.index-module--section--20zZC.index-module--hasBackgroundSecondary--2s7kJ.index-module--has-text-centered--3XPnf > div > div > div:nth-child(1) > form > div.index-module--field--AqZ9Y.index-module--is-horizontal--3thvl > div:nth-child(1) > div > div > input')
17 email_field.send_keys('spamemail' + str(i) +'@gmail.com')
18
19 comp_name = driver.find_element_by_css_selector('#gatsby-focus-wrapper > div > section.index-module--section--20zZC.index-module--hasBackgroundSecondary--2s7kJ.index-module--has-text-centered--3XPnf > div > div > div:nth-child(1) > form > div.index-module--field--AqZ9Y.index-module--is-horizontal--3thvl > div:nth-child(2) > div > div > input')
20 comp_name.send_keys('The ' + str(i) + ' spam company')
21
22 mess_field = driver.find_element_by_css_selector('#gatsby-focus-wrapper > div > section.index-module--section--20zZC.index-module--hasBackgroundSecondary--2s7kJ.index-module--has-text-centered--3XPnf > div > div > div:nth-child(1) > form > div:nth-child(4) > div > textarea')
23 mess_field.send_keys('Have fun with this ' + str(i) + ' messages spammed')
24
25 submit_button = driver.find_element_by_css_selector('#gatsby-focus-wrapper > div > section.index-module--section--20zZC.index-module--hasBackgroundSecondary--2s7kJ.index-module--has-text-centered--3XPnf > div > div > div:nth-child(1) > form > button')
26 submit_button.click()
27 time.sleep(5)
28
29 return_button = driver.find_element_by_css_selector('#back-link')
30
31 return_button.click()
32 time.sleep(5)
33
34 print ('The ' + str(i) + 'spam is being sent')