-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtest1.py
More file actions
29 lines (26 loc) · 885 Bytes
/
test1.py
File metadata and controls
29 lines (26 loc) · 885 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# coding=utf-8
# @公众号 : "鹏哥贼优秀"
# @Date : 2020/3/20
# @Software : PyCharm
# @Python version: Python 3.7.2
from selenium import webdriver
from slide_solution import *
import time
def visit_website(url):
driver = webdriver.Chrome('F:\\Python成长之路\\chromedriver.exe')
driver.maximize_window()
driver.get(url)
time.sleep(1)
# 输入帐户密码
driver.find_element_by_name('account').send_keys('手机号')
driver.find_element_by_name('password').send_keys('password')
slide_btn = driver.find_element_by_css_selector('span[class="nc_iconfont btn_slide"]')
# 滑块解决方法1
slide_solution1(slide_btn,driver)
time.sleep(1)
driver.find_element_by_class_name('btn').click()
time.sleep(5)
driver.quit()
if __name__ == "__main__":
url = 'https://login.zhipin.com/?ka=header-login'
visit_website(url)