Python + Selenium:是否可以通过手动单击和输入锁定浏览器? [英] Python+Selenium: Is it possible to lock the browser from manual clicks and inputs?

查看:529
本文介绍了Python + Selenium:是否可以通过手动单击和输入锁定浏览器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我写了一个python硒代码,可以自动执行网站上的操作.一旦用户对登录进行身份验证,硒将接管浏览器并执行其工作.一切正常,但是,我注意到,如果用户在运行硒时意外单击任何链接上的任何内容,代码可能会失败.

I have written a python selenium code which automates actions on a website. Once user authenticates the log in, selenium takes over the browser and does its thing. Everything works perfectly fine, however, I notice that the code may fail if user accidentally clicks anything on any links while selenium is running.

有没有一种方法可以防止用户手动输入?像这样:

Is there a way to prevent manual inputs from the user? something like:

br = webdriver.chrome()
br.lock_manual_userinput()

推荐答案

没有这样的东西.您可以将访问权限有限的计算机专用于运行自动化,或者如果您正在运行脚本,请小心操作.

There is no such thing. You can dedicate machine/s with limited access for running the automation or just be carful if you are working while running the scripts.

这篇关于Python + Selenium:是否可以通过手动单击和输入锁定浏览器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆