VT2019 Selenium Demo: Difference between revisions
Jump to navigation
Jump to search
Victor.Cuau (talk | contribs) (Create page + add demo code) |
Victor.Cuau (talk | contribs) (Add demo video links) |
||
Line 5: | Line 5: | ||
=Démonstration= |
=Démonstration= |
||
==Connexion à Facebook== |
==Connexion à Facebook== |
||
[https://drive.google.com/open?id=1M8THHoLihT9xrl9TtDQBFC_FtJamQR7b Vidéo de démonstration] |
|||
<source lang="python" line start="1"> |
<source lang="python" line start="1"> |
||
from selenium import webdriver |
from selenium import webdriver |
||
Line 33: | Line 35: | ||
==Affichage de l'emploi du temps de la filière INFO5 sur ADE== |
==Affichage de l'emploi du temps de la filière INFO5 sur ADE== |
||
[https://drive.google.com/open?id=1cX21esTwiaUwry67_ZJUpHjDxLlXLI_o Vidéo de démonstration] |
|||
<source lang="python" line start="1"> |
<source lang="python" line start="1"> |
||
import time |
import time |
Revision as of 15:41, 23 November 2019
Cette page héberge la démonstration en lien avec la fiche Selenium dans le cadre du cours de veille technologique 2019.
Pré-requis & Installation
Démonstration
Connexion à Facebook
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
# Credentials
user_name = "victor.cuau@hotmail.fr"
password = "VousAurezPasMonPassword"
# Launch the Chrome web browser
driver = webdriver.Chrome()
#driver.set_window_size(1400, 800)
# Load the Facebook website
driver.get("https://www.facebook.com")
# Enter the email address
element = driver.find_element_by_id("email")
element.send_keys(user_name)
# Enter the password
element = driver.find_element_by_id("pass")
element.send_keys(password)
# Press enter
element.send_keys(Keys.ENTER)
Affichage de l'emploi du temps de la filière INFO5 sur ADE
import time
from selenium import webdriver
# Launch the Chrome web browser
driver = webdriver.Chrome()
#driver.set_window_size(1400, 800)
# Load the page of the application ADE
driver.get("https://ade-sts.grenet.fr/direct/?data=1d04874d83cdeb530ab2ed27f8ac9ed37b49833cd1da9037e125b57a76b56adad09ddf0fa9386d6871978644e3168e1c010fd1cf0671c9ff9c3a152b08424f005b0f43ab5831667cc025f5e16438a90e7406158408bd7b08")
time.sleep(4) # Wait for the graphic interface
# Open folder "Etudiant"
folder = driver.find_element_by_xpath('//*[@id="Direct Planning Tree_-1"]/div/img[2]')
folder.click()
time.sleep(2)
# Open folder "POLYTECH"
folder = driver.find_element_by_xpath('//*[@id="Direct Planning Tree_12522"]/div/img[2]')
folder.click()
time.sleep(2)
# Open folder "INFO"
folder = driver.find_element_by_xpath('//*[@id="Direct Planning Tree_11584"]/div/img[2]')
folder.click()
time.sleep(2)
# Open folder "INFO 5"
folder = driver.find_element_by_xpath('//*[@id="Direct Planning Tree_11599"]/div/img[2]')
folder.click()
time.sleep(2)
# Click on "INFO5 - Option Réseaux"
edt = driver.find_element_by_xpath('//*[@id="Direct Planning Tree_x-auto-261"]/table/tbody/tr')
edt.click()