mirror of
https://github.com/balkian/gists.git
synced 2024-12-23 14:58:11 +00:00
Add 'repos/da5d5b45c894159b2f39/' from commit 'd8fa88487e04a227aa8b6ec162a6b0522a12af8a'
git-subtree-dir: repos/da5d5b45c894159b2f39 git-subtree-mainline:4b0eb4104e
git-subtree-split:d8fa88487e
This commit is contained in:
commit
34713e6562
5
repos/da5d5b45c894159b2f39/instrucciones.md
Normal file
5
repos/da5d5b45c894159b2f39/instrucciones.md
Normal file
@ -0,0 +1,5 @@
|
||||
# Las dependencias son:
|
||||
|
||||
```
|
||||
pip install fake-factory selenium
|
||||
```
|
25
repos/da5d5b45c894159b2f39/troll_doodle.py
Normal file
25
repos/da5d5b45c894159b2f39/troll_doodle.py
Normal 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()
|
Loading…
Reference in New Issue
Block a user