from selenium import webdriver
import time
from bs4 import BeautifulSoup
from urllib import request
import urllib url = "http://www.hsbkos.com/"
re = urllib.request.urlopen(url)
response = (re)
content = response.read()
soup = BeautifulSoup(content, 'lxml')
# soup = BeautifulSoup()
soup.findAll('div',{'class':'objbox'})
driver = webdriver.Chrome()
time.sleep(1)
driver.get(url)
time.sleep(1)
driver.maximize_window()
loginButton = driver.find_element_by_id('loginin').click() memberUsername = driver.find_element_by_name('memberUsername')
userPwd = driver.find_element_by_name('userPwd')
submitButton = driver.find_element_by_tag_name("strong") memberUsername.send_keys('17364550000')
userPwd.send_keys('******')
time.sleep(1)
submitButton.click()
time.sleep(1)
# driver.close()

  

python+selenium+webdriver+BeautifulSoup实现自动登录的更多相关文章

  1. Python Selenium Cookie 绕过验证码实现登录

    Python Selenium Cookie 绕过验证码实现登录 之前介绍过博客园的通过cookie 绕过验证码实现登录的方法.这里并不多余,会增加分析和另外一种方法实现登录. 1.思路介绍 1.1. ...

  2. 基于Requests和BeautifulSoup实现“自动登录”

    基于Requests和BeautifulSoup实现“自动登录”实例 自动登录抽屉新热榜 #!/usr/bin/env python # -*- coding:utf-8 -*- import req ...

  3. Python+Selenium+webdriver环境搭建(windows)以及相关资源下载链接

    今天记录一下测试小菜鸟alter在测试入门的一点关于python+Selenium+webdriver环境搭建的经历以及资源分享.欢迎交流学习,批评指正. 一.Python的下载与安装 1.pytho ...

  4. python selenium webdriver入门基本操作

    python selenium webdriver入门基本操作 未经作者允许,禁止转载! from selenium import webdriver import time driver=webdr ...

  5. Python Selenium Webdriver常用方法总结

    Python Selenium Webdriver常用方法总结 常用方法函数 加载浏览器驱动: webdriver.Firefox() 打开页面:get() 关闭浏览器:quit() 最大化窗口: m ...

  6. python webdriver 显示等待-自动登录126邮箱,添加联系人

    脚本内容:#encoding=utf-8#author-夏晓旭from selenium import webdriverimport timefrom selenium.webdriver.supp ...

  7. 一次完整的自动化登录测试-基于python+selenium进行cnblog的自动化登录测试

    Web登录测试是很常见的测试!手动测试大家再熟悉不过了,那如何进行自动化登录测试呢!本文作者就用python+selenium结合unittest单元测试框架来进行一次简单但比较完整的cnblog自动 ...

  8. 一次简单完整的自动化登录测试-基于python+selenium进行cnblog的自动化登录测试

    Web登录测试是很常见的测试,手动测试大家再熟悉不过了,那如何进行自动化登录测试呢!本文就基于python+selenium结合unittest单元测试框架来进行一次简单但比较完整的cnblog自动化 ...

  9. python+selenium破解极验验证登录

    1.前言: 目前很多网站会在正常的账号密码认证之外加一些验证码,以此来明确区分人/机行为,最典型的就是极验滑动验证.(如下图) 这里我们以简单实例说明如何实现自动校验类似验证. 2.步骤: 1)点击验 ...

随机推荐

  1. XXE外部实体注入漏洞——PHP

    前言 XXE Injection即XML External Entity Injection,也就是XML外部实体注入攻击.漏洞是在对非安全的外部实体数据进行处理时引发的安全问题. 在XML1.0标准 ...

  2. Golang switch语句总结

    switch 语句基本结构 switch 条件表达式 { case 常量表达式1: 语句 1 case 常量表达式2: 语句 2 . . . case 常量表达式n: 语句 n default: 语句 ...

  3. HTTP之基本认证机制

    1. 认证 1.1 HTTP 的质询/响应认证框架 HTTP 提供了一个原生的质询/响应(challenge/response)框架,简化了对用户的认证过程. HTTP 的认证模型如下图所示: Web ...

  4. Web Service 实例基于Socket创建Web服务

    ServerSocket服务器端代码如下: public static void main(String[] args) throws IOException { // 1:建立服务器端的tcp so ...

  5. OpenStack v.s. Kubernetes

    目录 文章目录 目录 What are the differences with OpenStack and Kubernetes? Why OpenStack & Kubernetes? W ...

  6. linux简单命令6---挂载

  7. 利用redis 分布式锁 解决集群环境下多次定时任务执行

    定时任务: @Scheduled(cron= "0 39 3 * * *") public void getAllUnSignData(){ //检查任务锁,若其它节点的相同定时任 ...

  8. matlab学习——01线性规划

    01线性规划 format compact; % min fx % Ax<=b % Aeq*x=beq % lb<=x<=ub % % max z=2x1+3x2-5x3 % x1+ ...

  9. getchwd() 函数返回当前工作目录。

    getchwd() 函数返回当前工作目录.

  10. Nonce

    Nonce是或Number once的缩写,在密码学中Nonce是一个只被使用一次的任意或非重复的随机数值. 在加密技术中的初始向量和加密散列函数都发挥着重要作用,在各类验证协议的通信应用中确保验证信 ...