【Rollo的Python之路】Python 爬虫系统学习 (六) Selenium 模拟登录

selenium 模拟登录

 

from selenium import webdriver
import time

driver = webdriver.Chrome()
driver.get("https://www.douban.com/")
driver.find_element_by_id("form_email").send_keys("your account")
driver.find_element_by_id("form_password").send_keys("password")

time.sleep(5)

driver.find_element_by_class_name("bn-submit").click()


cookies = {i["name"]:i["value"] for i in driver.get_cookies()}

print(cookies)

time.sleep(3)
driver.close()
driver.quit()

 

相关文章

转载地址:https://www.cnblogs.com/mini-monkey/p/12104821...
web自动化测试过程中页面截图相对比较简单,可以直接使用sel...
目录前言一、Selenium简介二、浏览器驱动1.浏览器驱动参考2....
一、iframe的含义:iframe是HTML中框架的一种形式,在对界面...
转载请注明出处❤️作者:测试蔡坨坨原文链接:caituotuo.to...
'''##**认识selenium**​**下载:pipinstall...