Selenium Qzone登陆

安卓学习笔记07:事件处理、窗口跳转与传递数据 文章目录零、学习目标一、三个基本控件1、标签控件(TextView)2、编辑框控件(EditText)3、按钮控件(Button)二、安卓事件处理机制(一)安卓事件处理概述2、安卓事件处理步骤三、案例演示:实现用户登录功能(一)运行效果(二)涉及知识点(三)实现步骤1、创建安卓应用【UserLogin】2、添加背景图片3、基于模板创建登录窗口LoginActivity4、登录窗口布局资源文件activity_login.xml5、主窗口布局资源文件activity_main.xml6、项目清单文件7、字符串 阅读详情
import time
from selenium import webdriver
from selenium.webdriver.common.keys import Keys

driver = webdriver.Chrome()
driver.maximize_window()

driver.get("http://i.qq.com/")

try:
    driver.find_element_by_id('login_div')
    a = True
except:
    a = False

if a == True:
    driver.switch_to.frame('login_frame')
    driver.find_element_by_id('switcher_plogin').click()
    driver.find_element_by_id('u').clear()#选择用户名框
    driver.find_element_by_id('u').send_keys('QQ')
    driver.find_element_by_id('p').clear()
    driver.find_element_by_id('p').send_keys('password')
    driver.find_element_by_id('login_button').click()
    time.sleep(3)

print(driver.page_source)

driver.close()

这里写图片描述

一开始直接找登陆的账号密码Element
但是却报错显示未查找到该Element
于是打印了下 page_source,查了下view-page
发现的确未有改元素

拜读了大佬的博客才知道这里使用了iframe加载了登陆框
然后就是定位该框,点击账号密码登录输入,点击登陆即可

用AI+Playwright实现零代码UI自动化测试:以登录页面为例的实战指南 本文详细介绍了如何利用AI与Playwright结合实现零代码UI自动化测试,特别以登录页面为例进行实战演示。通过自然语言描述生成测试脚本,大幅降低技术门槛,提升测试效率,并支持跨浏览器验证。适合非技术人员快速上手专业级自动化测试。 阅读详情

相关推荐

蓝牙Channel Sounding为真正的距离感知赋能

1:工作原理蓝牙™信道探测使用两种经过验证的测距方法——PBR(PBR)和RTT(RTT),实现蓝牙设备之间的安全精密测距。

weixin_43720159的博客 809

selenium爬取QQ空间

这几天在看《从零开始学python网络爬虫》中的模拟浏览器篇,对其中的爬取好友说说比较感兴趣,不过书中只是爬取每个好友第一页说说,因此我稍微改进了下(发书名是尊重作者,不过个人认为这本书讲得比较浅,不求甚解)。 先大致说一下我遇到的坑。首先,如果想要看别人的说说,是必须要登录的(使用cookie应该也可以);然后,可能没有权限访问好友空间;最后则是获取下一页链接并点击前还要注意可能没有下一页了。...

bull521的博客 1375

SMETANA 安装使用教程

关于SMETANA的安装和简单使用信息

qq_44940977的博客 1173

一.selenium爬取好友QQ空间日志说说

#coding:utf-8 from selenium import webdriver import time,os import xlrd,xlwt from xlutils.copy import copy #使用selenium #使用selenium的隐藏PhantimJS浏览器登陆账号后对内容获取 #注意frame与iframe的格式框切换 #driver = webdriver.Ph

Top_beyond的博客 4291

R语言笔记三:矩阵、数组、列表和数据框

1.矩阵        矩阵是二维的,需要有行和列。向量是一维的。        在R软件中,矩阵是有维数的向量,这里的矩阵元素可以是数值型、字符型或者逻辑型,但是每个元素必须拥有相同的模式,这个和向量一致。 (1)创建矩阵: m <- matrix(1:20,4,5) 行数和列数的分配必须满足分配条件。若分配的行列过大,分配的元素不足够,则报错。 m <-

weixin_44384631的博客 6211

告别城市峡谷定位漂移:手把手教你用PSINS仿真INS/NHC/ODO组合导航(附代码获取)

本文详细解析了INS/NHC/ODO组合导航系统在城市峡谷环境中的应用,通过PSINS平台实现精准定位。文章涵盖核心原理、环境搭建、算法实现及性能优化,帮助开发者解决GNSS信号中断时的定位漂移问题,提升自动驾驶系统在复杂环境中的可靠性。

weixin_30329623的博客 430

python爬虫实战笔记---selenium爬取QQ空间说说并存至本地

关于selenium和PhantomJS的使用,见python爬虫实战笔记---selenium爬取QQ空间说说并存至本地(上) 以下,正式开始对QQ空间进行分析和爬取 站点分析: 此版本的QQ空间,是以笔者自己的QQ空间为基点,利用selenium驱动PhantomJS,从上往下按照时间顺序爬取好友发过的说说文字,按照好友名进行分类 进入QQ空间首页,选择账号密码登录 在Chr

rytyy的博客 7477

复现:Mamba-UNet:降水临近预报的创新解决方案

Mamba-UNet通过其创新的双分支Mamba融合模块、多尺度时空注意力模块和动态分位数加权损失函数,在降水临近预报领域取得了显著的性能提升。它不仅在多种降水场景下表现出色,尤其在预测强降水事件方面展现出了强大的能力。这一创新模型为降水临近预报提供了一种新的解决方案,有望在未来的研究和应用中发挥更大的作用,为应对气候变化带来的挑战提供有力支持。随着技术的不断发展和优化,我们期待Mamba-UNet在更广泛的气象预报任务中发挥更大的价值,为各行各业提供更精准、更可靠的降水预报服务。

hanfeng5268的博客 916

Python零基础之selenium进阶:自动登录qq空间!

目标 通过selenium自动登录qq空间 获取cookie并保存成文件 通过requets加载headers实现自动登录qq空间 # !/usr/bin/python # Filename: selenium登录qq空间.py # Data : 2020/08/07 # Author : --king-- # ctrl+alt+L自动加空格格式化 from selenium import webdriver import time import json import requests

爬遍所有网站 360

硬件工程师学习-硬件的单元测试(UT)(1)电源与时钟的测试

我们在设计的时候,通过控制电源的上电使能管脚或者通过MOSFET、或者专用的电源上电控制芯片,控制不同电源的上电时序,以确保每个芯片的电源上电时序是满足芯片的要求的。我们在测试的时候,需要对相关的要求一一测试,以确认每个上电时序满足要求的。在维基百科中,相位噪声的定义是“时域不稳定性(抖动)导致波形在相位上发生快速、短期、随机的波动,这种波动在频域中的表现即为相位噪声”。单元测试,一般是指基于开发人员自行开展的功能测试及各个功能单元的单元测试,是硬件信号级的测试,分为基本测试和信号完整性测试。

qq_43416206的博客 4037

【从零开始入门unity游戏开发之——C#篇37】进程、线程、C# 中实现多线程有多种方案和async/await异步编程

进程、线程、C# 中实现多线程有多种方案和async/await异步编程

向宇的博客,专注php/web全栈 unity游戏开发,欢迎大家评论纠错 1473

python爬取加密qq空间_使用python+selenium爬取qq空间好友动态

使用python+selenium爬取qq空间好友动态分析过程如下:要想用selenium登陆qq空间,必须点击账号密码登陆按钮然后再填写账号密码登陆。1.PNG点击账号密码按钮后跳转到如下页面:2.PNG以上过程实现代码:# 这是你的chromedriver的对应版本文件chrome_driver = r'E:\迅雷下载\chromedriver_win32\chromedriver.exe'd...

weixin_39786850的博客 705

CAD二次开发c# .net加载cui\cuix菜单文件

public static void LoadMyCui(string cuiFile) { Document doc = Application.DocumentManager.MdiActiveDocument; object oldCmdEcho = Application.GetSystemVariable("CMDECHO"); object oldFileDia = Application.GetSys..

2128

Sympy 解方程

解普通方程from sympy import * x = Symbol('x') y = Symbol('y') print solve([2 * x - y - 3, 3 * x + y - 7],[x, y])解微积分 from sympy import * n = Symbol('n') s = ((n+3)/(n+2))**n#无穷为两个小写oprint limit(s, x, o

ReZero's Blog 1万+

IMSL CNL 7.0.0 (x86-64)Crack

IMSL CNL 7.0.0 (x86-64)Crack intel的算法库破解文件,这是C++版本的破解文件

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

图片转换字符

****图片转换字符从实验楼学习的图片转换字符 **安装pip后,pip install pillow 开始代码ascii.pyfrom PIL import Image import argparse#命令行输入参数处理 parser = argparse.ArgumentParser()parser.add_argument('file') #输入文件 parser.add_argu

ReZero's Blog 4543

汉书HE8,好用的汇编代码编写工具

汉书HE8,好用的汇编代码编写工具早期编写汇编代码所用功能强大

Python bz2

import bz2 un = 'BZh91AY&SYA\xaf\x82\r\x00\x00\x01\x01\x80\x02\xc0\x02\x00 \x00!\x9ah3M\x07<]\xc9\x14\xe1BA\x06\xbe\x084' pw = 'BZh91AY&SY\x94$|\x0e\x00\x00\x00\x81\x00\x03$ \x00!\x9ah3M\x13<]\xc9\x14\

ReZero's Blog 2370

android 蓝牙通讯demo

android 下蓝牙通讯demo,实现了发现蓝牙,使能蓝牙,通过蓝牙发送消息。

403 forbidden(Spider error)

(To ensure the safety, edit some words.) When I run a spider on Taobao get the error 403. As the above page image, it receive the response successfully. But if you open the request url on a new w...

ReZero's Blog 2046

简单爬取妹子图

本博文学自卧槽哥:采用Python2.7版本 http://cuiqingcai.com/3179.html关于转码问题的解决原链接 首先用 type检查编码 直接用str(title)不行 下面说方法:import sys reload(sys) sys.setdefaultencoding(‘utf-8’) path = str(title).strip().decode(‘utf-8’

ReZero's Blog 1922

python 逆向播放gif

从头条看到的from PIL import Image, ImageSequence from PIL import ImagePalette with Image.open('sd.gif') as im: if im.is_animated: frames = [f.copy() for f in ImageSequence.Iterator(im)] f

ReZero's Blog 1213

kali 漏洞利用

medusa -h target_ip -u uer -p passsword -M service u可替换为U后跟文件,同理p也可 M 后跟所攻击的服务(例如SSH) 2.

ReZero's Blog 793

Python闯关

# coding:utf-8 import requests import urllib2 import redef getChanllenge(p): return urllib2.urlopen('http://www.pythonchallenge.com/pc/' + p).read()import zipfile ##z = zipfile.ZipFile(getChanlleng

ReZero's Blog 688

Python 闯关

zip函数接受任意多个(包括0个和1个)序列作为参数,返回一个tuple列表 # coding:utf-8 import requests from PIL import Image,ImageDraw import urllib2 import re import StringIOdef getChanllenge(p): return urllib2.urlopen('http://ww

ReZero's Blog 552

Scrapy 初窥笔记

scrapy startproject YourProjectName建立scrapy项目 开始爬虫scrapy crawl SpiderName开始执行爬虫以上仿麻烦 根目录新建执行文件from scrapy.cmdline import execute execute(['scrapy', 'crawl', 'dingdian'])顶点为spider的name 定义爬取的字段就比如说爬小说

ReZero's Blog 518

Python闯关pickle

# coding:utf-8 import requests import redef getChanllenge(p): return requests.get("http://www.pythonchallenge.com/pc/"+p).text banner = getChanllenge("def/banner.p")import pickle data = pickle.load

ReZero's Blog 473

正则表达式IP

IP正则regexp: ((2[0-4]\d|25[0-5]|[01]?\d\d?).){3}(2[0-4]\d|25[0-5]|[01]?\d\d?)开始分析: 1. 0~255. 有三个然后加一个 0~255 2. 所以左边就是 0~255. 3. 去除点 . 分析0~255 4. 200~ 249: 2 0-4 d 5. 250 以上 25 0~5 6. 0~9

ReZero's Blog 469
上一篇: Scrapy 初窥笔记
下一篇: Https 升级(free)
ReZerou
博客等级 码龄10年 19粉丝 119原创
评论 3
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值