質問編集履歴
12
よう
    
        title	
    CHANGED
    
    | 
         @@ -1,1 +1,1 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
            Message: Unable to find a matching set of capabilities(marrionette On) 
     | 
| 
      
 1 
     | 
    
         
            +
            Message: Unable to find a matching set of capabilities(marrionette On)
         
     | 
    
        body	
    CHANGED
    
    | 
         
            File without changes
         
     | 
11
n
    
        title	
    CHANGED
    
    | 
         @@ -1,1 +1,1 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
            Message:  
     | 
| 
      
 1 
     | 
    
         
            +
            Message: Unable to find a matching set of capabilities(marrionette On) (至急)
         
     | 
    
        body	
    CHANGED
    
    | 
         @@ -9,7 +9,7 @@ 
     | 
|
| 
       9 
9 
     | 
    
         
             
                from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
         
     | 
| 
       10 
10 
     | 
    
         
             
                from selenium.webdriver.firefox.options import Options
         
     | 
| 
       11 
11 
     | 
    
         
             
                cap = DesiredCapabilities().FIREFOX
         
     | 
| 
       12 
     | 
    
         
            -
                cap["marionette"] =  
     | 
| 
      
 12 
     | 
    
         
            +
                cap["marionette"] = True
         
     | 
| 
       13 
13 
     | 
    
         
             
                retry=3
         
     | 
| 
       14 
14 
     | 
    
         
             
                for i in range(retry):
         
     | 
| 
       15 
15 
     | 
    
         
             
                    try:
         
     | 
| 
         @@ -30,7 +30,7 @@ 
     | 
|
| 
       30 
30 
     | 
    
         
             
            結果(options関係なし)
         
     | 
| 
       31 
31 
     | 
    
         
             
            ```python
         
     | 
| 
       32 
32 
     | 
    
         
             
            >>> driver2("https://teratail.com/questions/186288")
         
     | 
| 
       33 
     | 
    
         
            -
            Message:  
     | 
| 
      
 33 
     | 
    
         
            +
            Message: Unable to find a matching set of capabilities
         
     | 
| 
       34 
34 
     | 
    
         
             
            ```
         
     | 
| 
       35 
35 
     | 
    
         | 
| 
       36 
36 
     | 
    
         
             
            環境変数指定
         
     | 
| 
         @@ -49,6 +49,90 @@ 
     | 
|
| 
       49 
49 
     | 
    
         
             
            IDE(Spyder)ではMessage: 'geckodriver' executable needs to be in PATH.
         
     | 
| 
       50 
50 
     | 
    
         | 
| 
       51 
51 
     | 
    
         
             
            geckodriver はwget(url),tar (解凍),chmod(実行権限付与)
         
     | 
| 
       52 
     | 
    
         
            -
            (.exe形式でな 
     | 
| 
      
 52 
     | 
    
         
            +
            (.exe形式でない)
         
     | 
| 
       53 
53 
     | 
    
         | 
| 
      
 54 
     | 
    
         
            +
            firefox下のtree
         
     | 
| 
      
 55 
     | 
    
         
            +
            ```ubuntu
         
     | 
| 
      
 56 
     | 
    
         
            +
            attyan22@LAPTOP-SGBTV53C:/usr/bin/firefox$ tree
         
     | 
| 
      
 57 
     | 
    
         
            +
            .
         
     | 
| 
      
 58 
     | 
    
         
            +
            ├── firefox
         
     | 
| 
      
 59 
     | 
    
         
            +
            │   ├── Throbber-small.gif
         
     | 
| 
      
 60 
     | 
    
         
            +
            │   ├── application.ini
         
     | 
| 
      
 61 
     | 
    
         
            +
            │   ├── browser
         
     | 
| 
      
 62 
     | 
    
         
            +
            │   │   ├── blocklist.xml
         
     | 
| 
      
 63 
     | 
    
         
            +
            │   │   ├── chrome
         
     | 
| 
      
 64 
     | 
    
         
            +
            │   │   │   └── icons
         
     | 
| 
      
 65 
     | 
    
         
            +
            │   │   │       └── default
         
     | 
| 
      
 66 
     | 
    
         
            +
            │   │   │           ├── default128.png
         
     | 
| 
      
 67 
     | 
    
         
            +
            │   │   │           ├── default16.png
         
     | 
| 
      
 68 
     | 
    
         
            +
            │   │   │           ├── default32.png
         
     | 
| 
      
 69 
     | 
    
         
            +
            │   │   │           ├── default48.png
         
     | 
| 
      
 70 
     | 
    
         
            +
            │   │   │           └── default64.png
         
     | 
| 
      
 71 
     | 
    
         
            +
            │   │   ├── chrome.manifest
         
     | 
| 
      
 72 
     | 
    
         
            +
            │   │   ├── crashreporter-override.ini
         
     | 
| 
      
 73 
     | 
    
         
            +
            │   │   ├── features
         
     | 
| 
      
 74 
     | 
    
         
            +
            │   │   │   ├── formautofill@mozilla.org.xpi
         
     | 
| 
      
 75 
     | 
    
         
            +
            │   │   │   ├── screenshots@mozilla.org.xpi
         
     | 
| 
      
 76 
     | 
    
         
            +
            │   │   │   ├── webcompat-reporter@mozilla.org.xpi
         
     | 
| 
      
 77 
     | 
    
         
            +
            │   │   │   └── webcompat@mozilla.org.xpi
         
     | 
| 
      
 78 
     | 
    
         
            +
            │   │   └── omni.ja
         
     | 
| 
      
 79 
     | 
    
         
            +
            │   ├── chrome.manifest
         
     | 
| 
      
 80 
     | 
    
         
            +
            │   ├── crashreporter
         
     | 
| 
      
 81 
     | 
    
         
            +
            │   ├── crashreporter.ini
         
     | 
| 
      
 82 
     | 
    
         
            +
            │   ├── defaults
         
     | 
| 
      
 83 
     | 
    
         
            +
            │   │   └── pref
         
     | 
| 
      
 84 
     | 
    
         
            +
            │   │       └── channel-prefs.js
         
     | 
| 
      
 85 
     | 
    
         
            +
            │   ├── dependentlibs.list
         
     | 
| 
      
 86 
     | 
    
         
            +
            │   ├── firefox
         
     | 
| 
      
 87 
     | 
    
         
            +
            │   ├── firefox-bin
         
     | 
| 
      
 88 
     | 
    
         
            +
            │   ├── firefox-bin.sig
         
     | 
| 
      
 89 
     | 
    
         
            +
            │   ├── firefox.sig
         
     | 
| 
      
 90 
     | 
    
         
            +
            │   ├── fonts
         
     | 
| 
      
 91 
     | 
    
         
            +
            │   │   └── TwemojiMozilla.ttf
         
     | 
| 
      
 92 
     | 
    
         
            +
            │   ├── gmp-clearkey
         
     | 
| 
      
 93 
     | 
    
         
            +
            │   │   └── 0.1
         
     | 
| 
      
 94 
     | 
    
         
            +
            │   │       ├── libclearkey.so
         
     | 
| 
      
 95 
     | 
    
         
            +
            │   │       ├── libclearkey.so.sig
         
     | 
| 
      
 96 
     | 
    
         
            +
            │   │       └── manifest.json
         
     | 
| 
       54 
     | 
    
         
            -
             
     | 
| 
      
 97 
     | 
    
         
            +
            │   ├── gtk2
         
     | 
| 
      
 98 
     | 
    
         
            +
            │   │   └── libmozgtk.so
         
     | 
| 
      
 99 
     | 
    
         
            +
            │   ├── icons
         
     | 
| 
      
 100 
     | 
    
         
            +
            │   │   └── updater.png
         
     | 
| 
      
 101 
     | 
    
         
            +
            │   ├── libfreeblpriv3.chk
         
     | 
| 
      
 102 
     | 
    
         
            +
            │   ├── libfreeblpriv3.so
         
     | 
| 
      
 103 
     | 
    
         
            +
            │   ├── liblgpllibs.so
         
     | 
| 
      
 104 
     | 
    
         
            +
            │   ├── libmozavcodec.so
         
     | 
| 
      
 105 
     | 
    
         
            +
            │   ├── libmozavutil.so
         
     | 
| 
      
 106 
     | 
    
         
            +
            │   ├── libmozgtk.so
         
     | 
| 
      
 107 
     | 
    
         
            +
            │   ├── libmozsandbox.so
         
     | 
| 
      
 108 
     | 
    
         
            +
            │   ├── libmozsqlite3.so
         
     | 
| 
      
 109 
     | 
    
         
            +
            │   ├── libmozwayland.so
         
     | 
| 
      
 110 
     | 
    
         
            +
            │   ├── libnspr4.so
         
     | 
| 
      
 111 
     | 
    
         
            +
            │   ├── libnss3.so
         
     | 
| 
      
 112 
     | 
    
         
            +
            │   ├── libnssckbi.so
         
     | 
| 
      
 113 
     | 
    
         
            +
            │   ├── libnssdbm3.chk
         
     | 
| 
      
 114 
     | 
    
         
            +
            │   ├── libnssdbm3.so
         
     | 
| 
      
 115 
     | 
    
         
            +
            │   ├── libnssutil3.so
         
     | 
| 
      
 116 
     | 
    
         
            +
            │   ├── libplc4.so
         
     | 
| 
      
 117 
     | 
    
         
            +
            │   ├── libplds4.so
         
     | 
| 
      
 118 
     | 
    
         
            +
            │   ├── libsmime3.so
         
     | 
| 
      
 119 
     | 
    
         
            +
            │   ├── libsoftokn3.chk
         
     | 
| 
      
 120 
     | 
    
         
            +
            │   ├── libsoftokn3.so
         
     | 
| 
      
 121 
     | 
    
         
            +
            │   ├── libssl3.so
         
     | 
| 
      
 122 
     | 
    
         
            +
            │   ├── libxul.so
         
     | 
| 
      
 123 
     | 
    
         
            +
            │   ├── libxul.so.sig
         
     | 
| 
      
 124 
     | 
    
         
            +
            │   ├── minidump-analyzer
         
     | 
| 
      
 125 
     | 
    
         
            +
            │   ├── omni.ja
         
     | 
| 
      
 126 
     | 
    
         
            +
            │   ├── pingsender
         
     | 
| 
      
 127 
     | 
    
         
            +
            │   ├── platform.ini
         
     | 
| 
      
 128 
     | 
    
         
            +
            │   ├── plugin-container
         
     | 
| 
      
 129 
     | 
    
         
            +
            │   ├── plugin-container.sig
         
     | 
| 
      
 130 
     | 
    
         
            +
            │   ├── precomplete
         
     | 
| 
      
 131 
     | 
    
         
            +
            │   ├── removed-files
         
     | 
| 
      
 132 
     | 
    
         
            +
            │   ├── update-settings.ini
         
     | 
| 
      
 133 
     | 
    
         
            +
            │   ├── updater
         
     | 
| 
      
 134 
     | 
    
         
            +
            │   └── updater.ini
         
     | 
| 
      
 135 
     | 
    
         
            +
            └── geckodriver.log
         
     | 
| 
      
 136 
     | 
    
         
            +
            ```
         
     | 
| 
      
 137 
     | 
    
         
            +
            marionette off では 'str' object has no attribute 'launch_browser'
         
     | 
| 
      
 138 
     | 
    
         
            +
            firefox のインストールが原因?
         
     | 
10
naiyou
    
        title	
    CHANGED
    
    | 
         @@ -1,1 +1,1 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
            Message:  
     | 
| 
      
 1 
     | 
    
         
            +
            Message: The browser appears to have exited before we could connect. If you specified a log_file(至急)
         
     | 
    
        body	
    CHANGED
    
    | 
         @@ -9,14 +9,14 @@ 
     | 
|
| 
       9 
9 
     | 
    
         
             
                from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
         
     | 
| 
       10 
10 
     | 
    
         
             
                from selenium.webdriver.firefox.options import Options
         
     | 
| 
       11 
11 
     | 
    
         
             
                cap = DesiredCapabilities().FIREFOX
         
     | 
| 
       12 
     | 
    
         
            -
                cap["marionette"] =  
     | 
| 
      
 12 
     | 
    
         
            +
                cap["marionette"] = False
         
     | 
| 
       13 
13 
     | 
    
         
             
                retry=3
         
     | 
| 
       14 
14 
     | 
    
         
             
                for i in range(retry):
         
     | 
| 
       15 
15 
     | 
    
         
             
                    try:
         
     | 
| 
       16 
16 
     | 
    
         
             
                        options = Options()
         
     | 
| 
       17 
17 
     | 
    
         
             
                        options.headless = True
         
     | 
| 
       18 
18 
     | 
    
         
             
                        print("first")
         
     | 
| 
       19 
     | 
    
         
            -
                        browser=webdriver.Firefox(capabilities=cap, 
     | 
| 
      
 19 
     | 
    
         
            +
                        browser=webdriver.Firefox(capabilities=cap,options=options,)
         
     | 
| 
       20 
20 
     | 
    
         
             
                        print("second")
         
     | 
| 
       21 
21 
     | 
    
         
             
                    except Exception as e:
         
     | 
| 
       22 
22 
     | 
    
         
             
                        print(e)
         
     | 
| 
         @@ -50,4 +50,5 @@ 
     | 
|
| 
       50 
50 
     | 
    
         | 
| 
       51 
51 
     | 
    
         
             
            geckodriver はwget(url),tar (解凍),chmod(実行権限付与)
         
     | 
| 
       52 
52 
     | 
    
         
             
            (.exe形式でなし)
         
     | 
| 
      
 53 
     | 
    
         
            +
             
     | 
| 
       53 
54 
     | 
    
         
             
            エラーの理由わかりません
         
     | 
9
だい
    
        title	
    CHANGED
    
    | 
         @@ -1,1 +1,1 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
            Message: 'geckodriver' executable may have wrong permissions
         
     | 
| 
      
 1 
     | 
    
         
            +
            Message: 'geckodriver' executable may have wrong permissions(至急)
         
     | 
    
        body	
    CHANGED
    
    | 
         
            File without changes
         
     | 
8
ないよ
    
        title	
    CHANGED
    
    | 
         
            File without changes
         
     | 
    
        body	
    CHANGED
    
    | 
         @@ -44,10 +44,10 @@ 
     | 
|
| 
       44 
44 
     | 
    
         
             
            Mozilla Firefox 66.0.3
         
     | 
| 
       45 
45 
     | 
    
         
             
            OS windows10 (WSL インストール ubuntu)
         
     | 
| 
       46 
46 
     | 
    
         | 
| 
       47 
     | 
    
         
            -
            Anaconda 
     | 
| 
      
 47 
     | 
    
         
            +
            Anaconda同じ(windows用geckodriverもインストール済み from GitHub)
         
     | 
| 
       48 
48 
     | 
    
         | 
| 
       49 
     | 
    
         
            -
            IDE(Spyder)で 
     | 
| 
      
 49 
     | 
    
         
            +
            IDE(Spyder)ではMessage: 'geckodriver' executable needs to be in PATH.
         
     | 
| 
       50 
50 
     | 
    
         | 
| 
       51 
51 
     | 
    
         
             
            geckodriver はwget(url),tar (解凍),chmod(実行権限付与)
         
     | 
| 
       52 
     | 
    
         
            -
            (.exe形式で 
     | 
| 
      
 52 
     | 
    
         
            +
            (.exe形式でなし)
         
     | 
| 
       53 
     | 
    
         
            -
            エラーの理由 
     | 
| 
      
 53 
     | 
    
         
            +
            エラーの理由わかりません
         
     | 
7
めいん
    
        title	
    CHANGED
    
    | 
         
            File without changes
         
     | 
    
        body	
    CHANGED
    
    | 
         @@ -49,4 +49,5 @@ 
     | 
|
| 
       49 
49 
     | 
    
         
             
            IDE(Spyder)で実行するとMessage: 'geckodriver' executable needs to be in PATH.
         
     | 
| 
       50 
50 
     | 
    
         | 
| 
       51 
51 
     | 
    
         
             
            geckodriver はwget(url),tar (解凍),chmod(実行権限付与)
         
     | 
| 
       52 
     | 
    
         
            -
            (.exe形式ではない)
         
     | 
| 
      
 52 
     | 
    
         
            +
            (.exe形式ではない)
         
     | 
| 
      
 53 
     | 
    
         
            +
            エラーの理由はなんですか
         
     | 
6
すべて
    
        title	
    CHANGED
    
    | 
         @@ -1,1 +1,1 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
             
     | 
| 
      
 1 
     | 
    
         
            +
            Message: 'geckodriver' executable may have wrong permissions
         
     | 
    
        body	
    CHANGED
    
    | 
         @@ -16,7 +16,7 @@ 
     | 
|
| 
       16 
16 
     | 
    
         
             
                        options = Options()
         
     | 
| 
       17 
17 
     | 
    
         
             
                        options.headless = True
         
     | 
| 
       18 
18 
     | 
    
         
             
                        print("first")
         
     | 
| 
       19 
     | 
    
         
            -
                        browser=webdriver.Firefox(options=options)
         
     | 
| 
      
 19 
     | 
    
         
            +
                        browser=webdriver.Firefox(capabilities=cap,executable_path=r"/mnt/c/Users/a.sakata/AppData/Local/Packages/CanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgsc/LocalState/rootfs/usr/bin/local/geckodriver",options=options,)
         
     | 
| 
       20 
20 
     | 
    
         
             
                        print("second")
         
     | 
| 
       21 
21 
     | 
    
         
             
                    except Exception as e:
         
     | 
| 
       22 
22 
     | 
    
         
             
                        print(e)
         
     | 
| 
         @@ -30,11 +30,11 @@ 
     | 
|
| 
       30 
30 
     | 
    
         
             
            結果(options関係なし)
         
     | 
| 
       31 
31 
     | 
    
         
             
            ```python
         
     | 
| 
       32 
32 
     | 
    
         
             
            >>> driver2("https://teratail.com/questions/186288")
         
     | 
| 
       33 
     | 
    
         
            -
            Message:  
     | 
| 
      
 33 
     | 
    
         
            +
            Message: 'geckodriver' executable may have wrong permissions.
         
     | 
| 
       34 
34 
     | 
    
         
             
            ```
         
     | 
| 
       35 
35 
     | 
    
         | 
| 
       36 
36 
     | 
    
         
             
            環境変数指定
         
     | 
| 
       37 
     | 
    
         
            -
            C:\Users\a.sakata\AppData\Local\Packages\CanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgsc\LocalState\rootfs\usr\bin\geckodriver
         
     | 
| 
      
 37 
     | 
    
         
            +
            C:\Users\a.sakata\AppData\Local\Packages\CanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgsc\LocalState\rootfs\usr\local\bin\geckodriver
         
     | 
| 
       38 
38 
     | 
    
         
             
            C:\Users\a.sakata\AppData\Local\Packages\CanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgsc\LocalState\rootfs\usr\bin\firefox
         
     | 
| 
       39 
39 
     | 
    
         | 
| 
       40 
40 
     | 
    
         | 
| 
         @@ -45,4 +45,8 @@ 
     | 
|
| 
       45 
45 
     | 
    
         
             
            OS windows10 (WSL インストール ubuntu)
         
     | 
| 
       46 
46 
     | 
    
         | 
| 
       47 
47 
     | 
    
         
             
            Anacondaでも同様(windows用geckodriverもインストール済み from GitHub)
         
     | 
| 
      
 48 
     | 
    
         
            +
             
     | 
| 
      
 49 
     | 
    
         
            +
            IDE(Spyder)で実行するとMessage: 'geckodriver' executable needs to be in PATH.
         
     | 
| 
      
 50 
     | 
    
         
            +
             
     | 
| 
      
 51 
     | 
    
         
            +
            geckodriver はwget(url),tar (解凍),chmod(実行権限付与)
         
     | 
| 
       48 
     | 
    
         
            -
             
     | 
| 
      
 52 
     | 
    
         
            +
            (.exe形式ではない)
         
     | 
5
う
    
        title	
    CHANGED
    
    | 
         
            File without changes
         
     | 
    
        body	
    CHANGED
    
    | 
         @@ -16,7 +16,7 @@ 
     | 
|
| 
       16 
16 
     | 
    
         
             
                        options = Options()
         
     | 
| 
       17 
17 
     | 
    
         
             
                        options.headless = True
         
     | 
| 
       18 
18 
     | 
    
         
             
                        print("first")
         
     | 
| 
       19 
     | 
    
         
            -
                        browser=webdriver.Firefox( 
     | 
| 
      
 19 
     | 
    
         
            +
                        browser=webdriver.Firefox(options=options)
         
     | 
| 
       20 
20 
     | 
    
         
             
                        print("second")
         
     | 
| 
       21 
21 
     | 
    
         
             
                    except Exception as e:
         
     | 
| 
       22 
22 
     | 
    
         
             
                        print(e)
         
     | 
4
よ
    
        title	
    CHANGED
    
    | 
         
            File without changes
         
     | 
    
        body	
    CHANGED
    
    | 
         @@ -30,7 +30,7 @@ 
     | 
|
| 
       30 
30 
     | 
    
         
             
            結果(options関係なし)
         
     | 
| 
       31 
31 
     | 
    
         
             
            ```python
         
     | 
| 
       32 
32 
     | 
    
         
             
            >>> driver2("https://teratail.com/questions/186288")
         
     | 
| 
       33 
     | 
    
         
            -
             
     | 
| 
      
 33 
     | 
    
         
            +
            Message: invalid argument: can't kill an exited process
         
     | 
| 
       34 
34 
     | 
    
         
             
            ```
         
     | 
| 
       35 
35 
     | 
    
         | 
| 
       36 
36 
     | 
    
         
             
            環境変数指定
         
     | 
3
naiyo
    
        title	
    CHANGED
    
    | 
         
            File without changes
         
     | 
    
        body	
    CHANGED
    
    | 
         @@ -23,7 +23,6 @@ 
     | 
|
| 
       23 
23 
     | 
    
         
             
                        time.sleep(i*5)
         
     | 
| 
       24 
24 
     | 
    
         
             
                try:
         
     | 
| 
       25 
25 
     | 
    
         
             
                    browser.get(t)
         
     | 
| 
       26 
     | 
    
         
            -
                'firefox' executable needs to be in PATH.
         
     | 
| 
       27 
26 
     | 
    
         
             
                    return None
         
     | 
| 
       28 
27 
     | 
    
         
             
                print(browser.page_source)
         
     | 
| 
       29 
28 
     | 
    
         
             
                browser.quit()
         
     | 
2
naiyo
    
        title	
    CHANGED
    
    | 
         
            File without changes
         
     | 
    
        body	
    CHANGED
    
    | 
         @@ -16,7 +16,7 @@ 
     | 
|
| 
       16 
16 
     | 
    
         
             
                        options = Options()
         
     | 
| 
       17 
17 
     | 
    
         
             
                        options.headless = True
         
     | 
| 
       18 
18 
     | 
    
         
             
                        print("first")
         
     | 
| 
       19 
     | 
    
         
            -
                        browser=webdriver.Firefox(options=options)
         
     | 
| 
      
 19 
     | 
    
         
            +
                        browser=webdriver.Firefox(executable_path=r'C:\Users/a.sakata/AppData/Local/Packages/CanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgsc/LocalState/rootfs/usr/bin/firefox',options=options)
         
     | 
| 
       20 
20 
     | 
    
         
             
                        print("second")
         
     | 
| 
       21 
21 
     | 
    
         
             
                    except Exception as e:
         
     | 
| 
       22 
22 
     | 
    
         
             
                        print(e)
         
     | 
1
ないよ
    
        title	
    CHANGED
    
    | 
         
            File without changes
         
     | 
    
        body	
    CHANGED
    
    | 
         @@ -18,21 +18,20 @@ 
     | 
|
| 
       18 
18 
     | 
    
         
             
                        print("first")
         
     | 
| 
       19 
19 
     | 
    
         
             
                        browser=webdriver.Firefox(options=options)
         
     | 
| 
       20 
20 
     | 
    
         
             
                        print("second")
         
     | 
| 
       21 
     | 
    
         
            -
                    except:
         
     | 
| 
      
 21 
     | 
    
         
            +
                    except Exception as e:
         
     | 
| 
      
 22 
     | 
    
         
            +
                        print(e)
         
     | 
| 
       22 
23 
     | 
    
         
             
                        time.sleep(i*5)
         
     | 
| 
       23 
24 
     | 
    
         
             
                try:
         
     | 
| 
       24 
25 
     | 
    
         
             
                    browser.get(t)
         
     | 
| 
       25 
     | 
    
         
            -
                 
     | 
| 
      
 26 
     | 
    
         
            +
                'firefox' executable needs to be in PATH.
         
     | 
| 
       26 
27 
     | 
    
         
             
                    return None
         
     | 
| 
       27 
28 
     | 
    
         
             
                print(browser.page_source)
         
     | 
| 
       28 
29 
     | 
    
         
             
                browser.quit()
         
     | 
| 
       29 
30 
     | 
    
         
             
            ```
         
     | 
| 
       30 
     | 
    
         
            -
            結果
         
     | 
| 
      
 31 
     | 
    
         
            +
            結果(options関係なし)
         
     | 
| 
       31 
32 
     | 
    
         
             
            ```python
         
     | 
| 
       32 
33 
     | 
    
         
             
            >>> driver2("https://teratail.com/questions/186288")
         
     | 
| 
       33 
     | 
    
         
            -
             
     | 
| 
      
 34 
     | 
    
         
            +
            'firefox' executable needs to be in PATH.
         
     | 
| 
       34 
     | 
    
         
            -
            first
         
     | 
| 
       35 
     | 
    
         
            -
            first
         
     | 
| 
       36 
35 
     | 
    
         
             
            ```
         
     | 
| 
       37 
36 
     | 
    
         | 
| 
       38 
37 
     | 
    
         
             
            環境変数指定
         
     |