Templates 下的文件就是範本:

右鍵,新增文件就能使用建立好的範本:

雖然後來版本沒有預設的 Templates 目錄,但手動建立即可:
右鍵,新增資料夾,將資料夾重新命名文為:「Templates」。
or
終端機:
mkdir ~/Templates接著視自己的需求,放入範本,範本內容和名稱都能自訂。
例如:放入「新文件」作範本,新增文件時就能使用:

新增文件:

有模板的話,新增文件非常的快速方便。
「聽說自己寫過才不會忘。」 「會忘記的就寫起來,忘記了就看一下。」 「你知道2036的時候,今年就是10年前了嗎?」 「遇到的問題雖然有時候不值得一提,可是如果紀錄起來感覺也很有趣!」 「就是大家可以看到的筆記本而已。」
csrutil disable首先確定已經安裝了Python。
還沒有安裝的話,可以從Python官網 https://www.python.org 下載。
打開 terminal 或 cmd 輸入:
pip install seleniumSelenium 需要 webdriver 來控制瀏覽器。
依照自己使用的瀏覽器,下載適用於該瀏覽器版本的 webdriver。
以下是一些常用瀏覽器的 webdriver:
Google Chrome
https://sites.google.com/chromium.org/driver/
Firefox
https://github.com/mozilla/geckodriver/releases
下載後解壓縮,將 webdriver 放在於任何目錄都行。
如果你用 selenium 4.6 之後的版本,恭喜你不用另外下載 webdriver。
以下是一個簡單的範例程式碼,會打開 Google 首頁並搜尋關鍵字:
import time
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys
driver = webdriver.Chrome() # 除非更早以前的 selesium 版本,需要帶 webdriver 的路徑
# 打開網頁
driver.get("https://www.google.com")
# 在搜尋框中輸入關鍵字並送出
search_box = driver.find_element(By.NAME, "q")
search_box.send_keys("Python Selenium")
search_box.send_keys(Keys.ENTER)
# 等待3秒讓你看看而已(?)
time.sleep(3)
# 關閉瀏覽器
driver.quit()
gedit /etc/sysctl.confnet.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
net.ipv6.conf.lo.disable_ipv6 = 1sudo sysctl -p