Selenium 入门到精通系列


PS:用户登录

例子

#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Date    : 2019-04-23 16:12:33
# @Author  : BenLam
# @Link    : https://www.cnblogs.com/BenLam/

from selenium import webdriver
driver=webdriver.Firefox()
driver.get("http://www.baidu.com/")
driver.find_element_by_xpath("//cite[@id='login']/a").click();

driver.find_element_by_id("user").clear()
driver.find_element_by_id("user").send_keys("******")
driver.find_element_by_id("password").clear()
driver.find_element_by_id("password").send_keys("******")
driver.find_element_by_class_name("logging").click()

driver.quit()

相关文章:

  • 2021-05-31
  • 2021-12-12
  • 2021-11-14
  • 2021-10-08
  • 2021-06-20
  • 2021-11-19
  • 2021-09-19
猜你喜欢
  • 2021-11-21
  • 2022-02-13
  • 2021-07-04
  • 2021-07-21
  • 2021-06-08
  • 2021-11-21
  • 2021-10-28
相关资源
相似解决方案