IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Python Discussion :

Python, Selenium & Firefox


Sujet :

Python

  1. #1
    Candidat au Club
    Homme Profil pro
    Étudiant
    Inscrit en
    Octobre 2016
    Messages
    3
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 31
    Localisation : France, Seine et Marne (Île de France)

    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Octobre 2016
    Messages : 3
    Points : 2
    Points
    2
    Par défaut Python, Selenium & Firefox
    Salut tout le monde

    Je me suis mis à utiliser selenium depuis peu (actuellement au stade de l'experimentation) et j'ai besoin de votre aide : un message d'erreur ferme firefox automatiquement, sans afficher la page demandée.

    Voici le message d'erreur :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    Traceback (most recent call last):
      File "t.py", line 13, in <module>
        driver = webdriver.Firefox()
      File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/selenium/webdriver/firefox/webdriver.py", line 80, in __init__
        self.binary, timeout)
      File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/selenium/webdriver/firefox/extension_connection.py", line 52, in __init__
        self.binary.launch_browser(self.profile, timeout=timeout)
      File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/selenium/webdriver/firefox/firefox_binary.py", line 68, in launch_browser
        self._wait_until_connectable(timeout=timeout)
      File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/selenium/webdriver/firefox/firefox_binary.py", line 108, in _wait_until_connectable
        % (self.profile.path))
    selenium.common.exceptions.WebDriverException: Message: Can't load the profile. Profile Dir: /var/folders/9q/n5p6qkdn0r15zwt_ydw_hldw0000gn/T/tmpVeE3QF If you specified a log_file in the FirefoxBinary constructor, check it for details.
    Et mon code :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    from selenium import webdriver
     
    browser = webdriver.Firefox()
    browser.get('http://www.python.org')

  2. #2
    Modérateur
    Avatar de kolodz
    Homme Profil pro
    Ingénieur développement logiciels
    Inscrit en
    Avril 2008
    Messages
    2 211
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 36
    Localisation : France, Rhône (Rhône Alpes)

    Informations professionnelles :
    Activité : Ingénieur développement logiciels
    Secteur : High Tech - Produits et services télécom et Internet

    Informations forums :
    Inscription : Avril 2008
    Messages : 2 211
    Points : 8 316
    Points
    8 316
    Billets dans le blog
    52
    Par défaut
    Peux-tu nous indiquer la version de Selenium et la version de Firefox.
    D'après mes recherches, il semble qu'il y ai une incompatibilité de version.

    Cordialement,
    Patrick Kolodziejczyk.
    Si une réponse vous a été utile pensez à
    Si vous avez eu la réponse à votre question, marquez votre discussion
    Pensez aux FAQs et aux tutoriels et cours.

  3. #3
    Candidat au Club
    Homme Profil pro
    Étudiant
    Inscrit en
    Octobre 2016
    Messages
    3
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 31
    Localisation : France, Seine et Marne (Île de France)

    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Octobre 2016
    Messages : 3
    Points : 2
    Points
    2
    Par défaut
    J'utilise les dernières versions connues de chacun d'entre eux, donc selenium 3.0.0b3 et firefox 49.0

  4. #4
    Modérateur
    Avatar de kolodz
    Homme Profil pro
    Ingénieur développement logiciels
    Inscrit en
    Avril 2008
    Messages
    2 211
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 36
    Localisation : France, Rhône (Rhône Alpes)

    Informations professionnelles :
    Activité : Ingénieur développement logiciels
    Secteur : High Tech - Produits et services télécom et Internet

    Informations forums :
    Inscription : Avril 2008
    Messages : 2 211
    Points : 8 316
    Points
    8 316
    Billets dans le blog
    52
    Par défaut
    As-tu pris en compte cette information :
    By a quirk of timing, Mozilla have made changes to Firefox that mean that from Firefox 48 you must use their geckodriver to use that browser, regardless of whether you’re using Selenium 2 or 3.
    At the same time as the Selenium project is shipping Selenium 3.0, Mozilla are changing the internals of Firefox in a way that makes it more stable and secure, but which also makes the community provided Firefox Driver no longer work. As such, if you use Firefox for your testing, you’ll need to use the geckodriver, which is an executable similar to the chromedriver and the Microsoft WebDriver for Edge. You’ll need to start using geckodriver even if you’re using Selenium 2 — the change is in the browser, not Selenium. Please be aware that geckodriver is alpha software, based on the evolving W3C WebDriver standard: everyone’s working flat out to give you the best testing experience they can, but there are undoubtedly some bumps in the road when it comes to testing with Firefox.
    Cordialement,
    Patrick Kolodziejczyk.
    Source : Blog Selenium
    Si une réponse vous a été utile pensez à
    Si vous avez eu la réponse à votre question, marquez votre discussion
    Pensez aux FAQs et aux tutoriels et cours.

  5. #5
    Candidat au Club
    Homme Profil pro
    Étudiant
    Inscrit en
    Octobre 2016
    Messages
    3
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 31
    Localisation : France, Seine et Marne (Île de France)

    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Octobre 2016
    Messages : 3
    Points : 2
    Points
    2
    Par défaut
    J'ai téléchargé geckodriver mais ça a l'air plus compliqué...
    En tout cas ça marche avec la version 47.0 de firefox !
    Merci beaucoup

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. Surcharge attribut de [class] Python/ [selenium]
    Par progsam dans le forum Général Python
    Réponses: 6
    Dernier message: 20/07/2016, 13h44
  2. Activer un bouton windows ? Python + selenium
    Par momo8508 dans le forum Réseau/Web
    Réponses: 3
    Dernier message: 30/06/2016, 11h53
  3. [PHPUnit] Combiné à Selenium IDE/RC extension firefox ?
    Par bilred dans le forum Bibliothèques et frameworks
    Réponses: 1
    Dernier message: 19/03/2010, 15h14
  4. Selenium IDE/RC extension firefox
    Par nico33410 dans le forum Autres langages pour le Web
    Réponses: 5
    Dernier message: 17/11/2008, 16h03

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo