1
0
mirror of https://github.com/balkian/gists.git synced 2024-11-24 10:22:28 +00:00
This commit is contained in:
J. Fernando Sánchez 2014-10-07 15:29:25 -07:00
commit a62feefcb6
2 changed files with 30 additions and 0 deletions

5
instrucciones.md Normal file
View File

@ -0,0 +1,5 @@
# Las dependencias son:
```
pip install fake-factory selenium
```

25
troll_mapal.py Normal file
View File

@ -0,0 +1,25 @@
from selenium import webdriver
from selenium.webdriver.support.ui import Select
from faker import Factory
import random
fake = Factory.create('it_IT')
dood = "http://doodle.com/arcgntcrzqeqr2c6"
driver = webdriver.Firefox()
driver.implicitly_wait(3) # seconds
for i in range(0,10):
name = fake.first_name()
driver.get(dood)
nam = driver.find_element_by_xpath('//*[@id="pname"]')
nam.send_keys(name)
print nam
option = random.randint(0,2)
opt = driver.find_element_by_xpath('//*[@id="option{}"]'.format(option))
opt.click()
sav = driver.find_element_by_xpath('//*[@id="save"]')
sav.click()
import time
time.sleep(2)
driver.quit()