Last active
September 16, 2023 02:27
-
-
Save 18bai-Kaiohken/579a49b47c7910f0e0e3589a7562a6b4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#必要なライブラリ類のインポート | |
from selenium import webdriver #selenium関連のライブラリーは、pythonからブラウザを操作するために使用します。 | |
from selenium.webdriver.chrome.service import Service | |
from selenium.webdriver.common.by import By | |
from selenium.webdriver.common.action_chains import ActionChains | |
import pyautogui #pythonからマウスカーソルを操作するために使用します。 | |
import time | |
# chromedriver.exeがダウンロードされた場所を指定します。 | |
#今回の例では /usr/bin/chromedriver という場所にchromedriver.exeがダウンロードされています。 | |
driver_path = "/usr/bin/chromedriver" #ここの値は各自で設定してください。 | |
# webdriverの作成 | |
service = Service(executable_path=driver_path) #executable_pathを指定 | |
driver = webdriver.Chrome(service=service) #serviceを渡す | |
#ウインドウを最大化する | |
driver.maximize_window() | |
#はてなブログのログインページへ移動する | |
driver.get('ここにログイン画面のURLを入力')#ここにログイン画面のURLを入力してください |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment