technique:python:selenium

Différences

Ci-dessous, les différences entre deux révisions de la page.

Lien vers cette vue comparative

Les deux révisions précédentes Révision précédente
Prochaine révision
Révision précédente
technique:python:selenium [2021/07/15 21:51] francoisatechnique:python:selenium [2024/04/02 15:08] (Version actuelle) – modification externe 127.0.0.1
Ligne 1: Ligne 1:
-====== Selenium ====== +**Cette page est obsolèteVeuillez accéder au contenu à son nouvel emplacement : [[https://bibliotech.cemea.org/books/outils-technique/page/selenium|selenium]]**
- +
-pour tests d'interface web : [[https://www.selenium.dev/downloads/|https://www.selenium.dev/downloads/]] +
- +
-Ressources : +
- +
-  https://ichi.pro/fr/une-procedure-pas-a-pas-detaillee-de-web-scraping-a-l-aide-de-python-et-selenium-21381292843933 +
-  https://www.ionos.fr/digitalguide/sites-internet/developpement-web/tutoriel-selenium-webdriver/ +
-  * https://www.selenium.dev/documentation/fr/getting_started/ +
- +
-Pré-recquis +
- +
-  - un navigateur compatible : Firefox, Chrome, Chromium, IE +
-  - une API Webdriver (binaire) pour le navigateur : +
-      - Chromium : [[https://chromedriver.chromium.org/|https://chromedriver.chromium.org/]] +
-      Firefox : [[https://github.com/mozilla/geckodriver/|https://github.com/mozilla/geckodriver/]] +
-  - la lib pyhon selenium (via pip ou virtualenv) +
-  - Un script (python) qui appelle la lib et le binaire +
- +
-Placer le binaire dans le path ou spécifier le chemin dans le script +
- +
-Exemple : +
- +
-<code python> +
-import time +
- +
-from selenium import webdriver +
-from selenium.webdriver.chrome.service import Service +
- +
-service = Service('/path/to/chromedriver'+
-service.start() +
-driver = webdriver.Remote(service.service_url) +
-driver.get('http://www.google.com/'); +
-time.sleep(5) # Let the user actually see something! +
-driver.quit() +
- +
- +
-</code> +
- +
  • technique/python/selenium.1626378689.txt.gz
  • Dernière modification : 2021/07/15 21:51
  • de francoisa