【发布时间】:2022-01-14 13:08:46
【问题描述】:
我写了一些 python 脚本结合 selenium 来自动登录一个网站,它在我的电脑上运行良好。 现在我将脚本压缩为exe文件以在远程PC上运行,但它无法加载页面,卡在“访问xxx之前检查您的浏览器”。 为什么?
这是我的代码:
op = webdriver.ChromeOptions()
op.add_experimental_option('excludeSwitches',['enable-logging'])
ser = Service('chromedriver.exe')
wd = webdriver.Chrome(service=ser,options=op)
wd.get(self.url)
# time.sleep(30)
try:
email_input = WebDriverWait(wd,30).until(
EC.presence_of_element_located((By.ID,"user_email"))
)
except Exception as e:
print(e)
【问题讨论】: