Skip to content

Instantly share code, notes, and snippets.

@arthur-tomsjj
Created July 26, 2020 05:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save arthur-tomsjj/c4258fc2158ecf1c0b75440366dd4512 to your computer and use it in GitHub Desktop.
Save arthur-tomsjj/c4258fc2158ecf1c0b75440366dd4512 to your computer and use it in GitHub Desktop.
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
import time
url = "https://accounts.pixiv.net/login?return_to=https%3A%2F%2Fwww.pixiv.net%2F&lang=zh_tw&source=pc&view_type=page"
driver = webdriver.Chrome("D:\\PythonLab\\chromedriver_win32\\chromedriver.exe")
driver.get(url)
elem_user = driver.find_element_by_xpath("//input[@autocomplete = 'username']")
elem_user.send_keys("電子信箱帳號")
elem_pwd = driver.find_element_by_xpath("//input[@autocomplete = 'current-password']")
elem_pwd.send_keys("pixiv密碼")
elem_pwd.send_keys(Keys.RETURN)
time.sleep(5)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment