python+selenium+chromdriver 图书馆预约和签到程序

签到APP软件代码 类似于南京痕迹网络科技有限公司开发的“我去图书馆”的框架。实现功能包括登陆,管理员登陆,定位签到,签到计时,导出学习时长等 立即下载

GMAIL:lianghaioh@gmail.com

更新与纠正(2021/10/13)

程序已集成预约和签到功能。
预约:预约明天的座位
签到:完成今天的预约,需要程序一直保持在后台
通知:邮件提醒

Bug: 周四执行程序时会出现预约错误,原因是图书馆周五下午不开放,目前正在解决,等周四的时候在测试。
相关文件下载

图书馆系统界面

1.预约与管理

在这里插入图片描述

2. 扫码签到

在这里插入图片描述

1. Webdriver安装与配置

1.1 下载 chromedriver

  1. 用chrome浏览器打开 查看版本

  2. 在此处下载与版本相对应的chromedriver

  3. 将 chromedriver放在python路径下

  4. 测试是否配置成功

2. 相关python包

pip install selenium
pip install json
pip install smtp

3. 配置文件说明

{
   
   
"userName":"*************",#登录10.240.32.6:8099 的用户名
"password":"************", # 密码
"url":"http://update.unifound.net/wxnotice/s.aspx?c=100601185_Seat_100601462_1FC", # 座位二维码提取出的url,可以在 https://jiema.wwei.cn/ 中提取
"email":"260936@qq.com", # 接受消息的邮箱
"floor":4, # 楼层
"room":3, # 这个在网页上看房间在所在楼层的顺序,从1开始,例如403东的顺序是3
"seatId":86 # 座位的号码
}

4. 说明

4.1 预约

固定时段

[8:00 - 13:00] [13:00 - 18:00] [18:00 - 22:00]

由于周五白天只能预约到12:00。因此,程序在周四当天会出现预约错误。

另外,好久之前的代码了,印象模糊,所以就先将就着用吧。我会直接提供源码

4.2 签到

根据预约时段,程序会在 [8:00] [13:00] [18:00] 自动签到。

4.3 使用说明

在早上8点左右打开程序后直接挂着就行,如果相结合windows设置计划程序,那么需要自行修改程序,直接修改Mains()函数即可。

5. 源代码

from selenium import webdriver
import time
import datetime
import calendar
import smtplib
import json
from email.mime.text import MIMEText

class Lib:
    def __init__(self):
        with open("./default.json") as fp:
            Info = json.load(fp)
            self.user = Info["userName"]
            self.pwd = Info["password"]
            self.url = Info["url"]
            self.email = Info["email"]
            self.floor = Info["floor"]
            self.room = Info["room"]
            self.id = Info["seatId"]
            self.appoint = "http://10.240.32.6:8099/ClientWeb/xcus/ic2/Login.aspx?sys=person"
    '''
    @Date: 2021/09/09
    @Message: Send-Email-Server Default
    '''
    def sendEmail(self,text,remail):
        smtp = "smtp.163.com";
        subject = "图书馆占座"
        sender = "messagesmxy@163.com";  # send email
        pwds = "FYWRZLZFYDNBZLYL";  # security Code
        content = text;  # Message Text
        recver = remail;  # Receive email address
        message = MIMEText(content, "plain", "utf-8");
        message['Subject'] = subject;
        message['To'] = recver;
        message['Form'] = sender;
        smtp = smtplib.SMTP_SSL(smtp, 994);  # 实例化邮箱
        smtp.login(sender, pwds);  # 登录
        smtp.sendmail(sender, [recver], message.as_string())
        smtp.close();
        return 1;
    '''
    @Date: 2021/09/09
    @Message: 返回相应坐标
    '''
    def Dates(self):
        date = []
        year = datetime.datetime.now().year
        month = datetime.datetime.now().month
        day = datetime.datetime
签到代码,签到功能 立即下载

相关推荐

智位来图书馆自动预约座位脚本.rar

适合智位来图书馆自动座位预约,需auto.js支持,

Python爬虫实现自动登录、签到功能的代码

主要介绍了Python爬虫实现自动登录、签到功能的代码,本文通过图文并茂的形式给大家介绍的非常详细,对大家的学习或工作具有一定的参考借鉴价值,需要的朋友可以参考下

Python实现自动签到脚本功能

实训课期间忙里偷闲的学习了python的selenium包,唯一一点不好是要自己去查英文文档,明摆着欺负我这种英语不好的,想着用谷歌翻译一下,代码也给我翻译了,不知道是几个意思。 大二的时候就让我们做自动签到脚本,说用JS可以写一下,但是说着说着就给忘了,现在学了python后又想起来要写一个自动签到的脚本,不得不佩服python的强大,短短二十行左右的代码就实现了,虽然说脚本还需要手动操作去运行,以后还是可以慢慢优化的。 开发环境 : Windows10 + sublime(编辑器装好python环境) selenium的开发文档网址(英语好的可以直接看这个,写的很详细):http://se

【Office激活】学校正版Office已激活成功仍弹出激活窗口

学校正版Office激活问题:已激活成功仍弹出激活窗口

ESCM_的博客 1万+

保姆级教程:用+86手机号成功注册Discord的三种亲测方法(附节点选择技巧)

本文提供了三种经过验证的方法,帮助用户使用+86手机号成功注册Discord,包括号码格式调整、网络环境优化和设备组合方案。同时详细解析了'手机号无效'报错的深层原因,并附上节点选择技巧,确保注册流程顺利。

weixin_42683394的博客 1903

C#开发医学影像胶片打印系统(一):万能花式布局的实现思路

本篇文章将介绍开发医学影像胶片打印系统(printscu模式)遇到不规则排版时的一种思路,一般来讲,医院打印胶片时都是整张胶片打印,但有时需要将多个病人或一个病人的多个检查打印在同一张胶片上,这时候就需要不规则排版来满足打印需求,使胶片利用率最大化。

罗万科技的博客 1325

用5毫欧采样电阻实现高精度电流检测?数字可调电源控制板的硬件设计陷阱

本文深入探讨了在数字可调电源控制板设计中,如何利用5毫欧采样电阻实现高精度电流检测。从微小信号放大电路设计、采样电阻布局与热管理,到电源切换与电池管理电路优化,提供了全面的硬件设计解决方案和实用技巧,帮助工程师规避常见设计陷阱,提升系统性能。

wdx0123456的博客 1029

机器人C++开源库The Robotics Library (RL)使用手册(三)

进入VS工程,我们先看看这些功能函数及其依赖库的分布关系:rl命名空间下,主要有八大模块。搞定VS后将逐个拆解。

qq_34839823的博客 1736

NetSuite软件二次开发:NetSuite二次开发最佳实践与案例分析

SuiteScript是NetSuite提供的一种用于二次开发的脚本语言,它基于JavaScript,但添加了特定的API和框架,以支持NetSuite平台的业务逻辑开发。SuiteScript有两种版本:SuiteScript 1.0和SuiteScript 2.0,后者提供了更现代的面向对象编程模型,增强了代码的可读性和可维护性。NetSuite允许用户自定义字段以满足特定的业务需求。这些字段可以添加到现有的记录类型中,也可以用于自定义记录。自定义字段可以是文本、数字、日期、下拉列表等多种类型。

kkchenjj的博客 1465

【实战篇】【硅基流动API+Cherry Studio搭建个人知识库全流程解析:从零到精通的超详细指南】

在人工智能技术高速发展的今天,基于大语言模型的知识库已成为开发者提效的必备工具。然而云端服务存在响应延迟、数据隐私、硬件依赖等痛点。通过硅基流动API与的深度整合,我们既能享受大模型的强大能力,又能实现本地化部署与高效管理。本文将从环境配置到高阶调优,手把手带你构建企业级知识库系统。

商务合作|问题讨论|交流学习 请联系作者微信,加微信请务必注明来意,博客主页有联系方式 1082

Field Characteristics 深入解析,理解 SAP ABAP Analytics 中 Dimension 与 Measure 的真正边界

在SAP ABAP Analytics数据模型中,字段应建模为Dimension还是Measure,关键在于业务语义而非数据类型。Dimension提供分析上下文,构成数据坐标系,支持钻取与切片;Measure则需具备明确聚合语义(如#SUM、#MIN、#MAX),且必须满足Distinct(无重复)与Complete(无缺失)原则,确保聚合结果准确。错误的建模会导致聚合偏差,根源常在事实粒度不清或关联关系不当。因此,正确划分字段角色,本质是让Analytical Engine准确理解业务数据的分析逻辑。

2007 年 ~ 2025 年,深耕 SAP 技术 18 年 56

深度学习工具包 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")

visio安装包

Microsoft Office Visio 是一款专业的制图软件。利用经过更新的形状、协作工具和数据链接图表,创建专业级图表以简化复杂的信息。

上一篇: 蓝桥杯——付账问题_2018年
下一篇: 4 朴素贝叶斯法
Ai_Math
博客等级 码龄7年 218粉丝 17原创
评论 17
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值