步驟一、下載Python
官方下載網址
步驟二、下載Selenium套件 > [命令提示字元]
在Windows環境下,須至[命令提示字元]執行[pip.exe]檔案,輸入[install selenium]
範例:C:\Python\Python3.6.5\Scripts\pip.exe install selenium
步驟三、下載ChromeDriver檔案
官方下載網址
步驟四、修改Python設定檔[subprocess.py]
在Windows環境下,須將[subprocess.py]檔案中[Shell=False]字串取代為[Shell=True],否則執行會失敗
步驟五、建立[example.py]檔案並執行
-------------------------------------------------
以下程式碼是使用Chrome開啟"http://www.python.org"網頁並關閉
-------------------------------------------------
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
driver = webdriver.Chrome("C:\Program Files\Google\Chrome\Application\chromedriver.exe")
driver.get("http://www.python.org")
assert "Python" in driver.title
elem = driver.find_element_by_name("q")
elem.clear()
elem.send_keys("pycon")
elem.send_keys(Keys.RETURN)
assert "No results found." not in driver.page_source
driver.close()
-------------------------------------------------
步驟六、參考文獻
Selenium文件網址
2018年3月31日 星期六
2018年3月30日 星期五
[Windows] IIS7.0設定
步驟1、至[控制台] > [程式集] > [取得程式]
步驟2、開啟或關閉Windows功能
步驟3、[IIS] > [Web管理工具] > 勾選[IIS]功能
步驟4、[Word Wide Web服務] > [程式及功能開發]
步驟2、開啟或關閉Windows功能
步驟3、[IIS] > [Web管理工具] > 勾選[IIS]功能
步驟4、[Word Wide Web服務] > [程式及功能開發]
訂閱:
意見 (Atom)
[JQuary][C#]使用jQuary實作form action post參數
網頁轉址一般分為 1.直接導向Url 2.夾帶Get參數在Url後面 如果要使用Post的方式要如何跳轉呢? Ans:使用Form Action 設定Method='Post' 範例前端程式 -----------------------------...
-
網頁轉址一般分為 1.直接導向Url 2.夾帶Get參數在Url後面 如果要使用Post的方式要如何跳轉呢? Ans:使用Form Action 設定Method='Post' 範例前端程式 -----------------------------...
-
Step1、 取得GitHub程式 GitHub Step2、 取得維基百科中文字庫(.bz2檔案) 維基百科字庫 Step3、 安裝套件[gensim] Python3.6 模擬器 > 右鍵 > 安裝Python套件 >查詢[gens...



