<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ??碼云GVP開源項目 12k star Uniapp+ElementUI 功能強大 支持多語言、二開方便! 廣告
                # Selenium 瀏覽器 > 原文: [https://pythonbasics.org/selenium_browsers/](https://pythonbasics.org/selenium_browsers/) Selenium 使您可以自動化 Web 瀏覽器。 Selenium 是一個 Python 模塊。 除了 Python 模塊之外,您還需要 Web 驅動程序。 通過 Python,您可以控制 Firefox,Chrome,Internet Explorer,Edge 和許多其他瀏覽器。 您可以打開一個新的 URL,單擊按鈕等等。 ## 網絡瀏覽器 ### Selenium 瀏覽器 下面的 Selenium 瀏覽器代碼啟動了多個 Web 瀏覽器。 他們打開一個網站,然后關閉瀏覽器。 必須安裝 Web 驅動程序才能起作用。 ```py #-*- coding:utf-8 -*- from selenium import webdriver import time from tomorrow import threads def startBrowser(name): """ browsers,"firefox"、"chrome"、"ie"、"phantomjs" """ try: if name == "firefox" or name == "Firefox" or name == "ff": print("start browser name :Firefox") driver = webdriver.Firefox() return driver elif name == "chrome" or name == "Chrome": print("start browser name :Chrome") driver = webdriver.Chrome() return driver elif name == "ie" or name == "Ie": print("start browser name :Ie") driver = webdriver.Ie() return driver elif name == "phantomjs" or name == "Phantomjs": print("start browser name :phantomjs") driver = webdriver.PhantomJS() return driver else: print("Not found this browser,You can use ‘firefox‘, ‘chrome‘, ‘ie‘ or ‘phantomjs‘") except Exception as msg: print("message: %s" % str(msg)) @threads(5) def run_case(name): driver = startBrowser(name) driver.get("https://news.ycombinator.com/") time.sleep(3) print(driver.title) driver.close() driver.quit() if __name__ == "__main__": names = ["chrome", "ff", "ie"] for i in names: run_case(i) ``` ![selenium browsers](https://img.kancloud.cn/04/62/04626325b904ebeda48d3eb0d0efe642_683x377.jpg) [下載示例](https://gum.co/GjuJxo)
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看