發表文章

目前顯示的是 10月, 2019的文章

[VB]網頁自動傳值(Hub 和Node同一台)

圖片
想設計一個可以由自已設計的網頁,將網頁某個元件值帶入GOOGLE首頁搜詢框。 首先,需要先到NuGet下載 Selenium 下載完成後,就可以開始寫code啦 引用 Imports OpenQA.Selenium.Chrome   Function SetUp(url As String, js As StringBuilder)         Dim options As ChromeOptions = New ChromeOptions()         options.AddArguments("disable-infobars")         Dim driver = New ChromeDriver(options)         driver.Manage().Window().Maximize()         driver.Manage().Cookies.DeleteAllCookies()         driver.Navigate().GoToUrl(url)         driver.ExecuteScript(js.ToString)         Return True     End Function     Protected Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click         url = "https://www.google.com/"         js.Append("document.getElementsByName('q')[0].value='" + TextBox1.Text + "'")         SetUp(url, js)     End Sub 紅色框起來的部分, 在SetUp funcation有寫到關閉「chrome目前受自動軟體控制。」 但好像因為版本問題,有些可以成功,有些卻還是有出現 就當待解囉。

[Python]python安裝與打包exe

圖片
首先 安裝python(版本不要求) Python官網 可以參考此網頁安裝方式 安裝Selenium 1。開啟cmd 2。指向安裝python目錄 3。 pip install selenium 下載 webdriver Chrome & Firefox的webdriver傳送門 Firefox web driver Chrome web driver 下載完成後,將zip裡檔案解壓縮到python目錄裡。 安裝 pyinstaller 1。在cmd 2。指向安裝python目錄 3。輸入 pip install pyinstaller 第一個範例: 開新網頁,新增一個按鈕,當按下按鈕後,會開啟google首頁並自輸填入搜詢的值。 首先 HTML 建立一個html,並新增button <button onclick="open_exe('C:\\Users\\USER\\Desktop\\google.exe')">打开google</button> PYTHON 建立新檔案, 並輸入 from selenium import webdriver browser = webdriver.Chrome() browser.get('https://www.google.com/') element = browser.find_element_by_name("q"); element.send_keys('hello world'); 儲存檔案並命名為 google.py。 pyinstaller 使用方法教學 py檔案要轉成exe: 1. 開啟cmd 2. 輸入 pyinstaller -F google.py 按enter 3.在python目錄裡,找dist資料夾,就可以看到轉的exe [ 轉exe過程錯誤訊息與解法 1。 from selenium import webdriver ^ IndentationError: unexpected indent 解法: 開啟要轉exe的檔案,再次檢視 發現 from selenium impo

[Angular]自學#2 安裝VSCode 和 Augury

圖片
code 編輯器是使用 Microsoft VS Code 安裝完 VSCode 之後,下載  Angular Extension Pack  的擴充套件。 再來是安裝 Augury