繁体   English   中英

python selenium webdriver 不工作问题

[英]python selenium webdriver doesn't work problem

我制作了这个应该登录到文本的程序,现在登录并打电话给我想打电话的任何人。 使其尽可能高效。 但是当我运行它时,除了最终值之外,脚本仍然有效,我不知道错误是什么。 但是,我会很感激任何答案。

#imports
import time
from selenium import webdriver
from getpass  import getpass

username = input('Enter in your username: ')
password = getpass('Enter your password: ')
number = input('Enter number to spam: ')

driver = webdriver.Chrome('C:\\WebDriver\\chromedriver.exe')
driver.get('https://www.textnow.com/login')

username_textbox = driver.find_element_by_id('txt-username')
username_textbox.send_keys(username)

password_textbox = driver.find_element_by_id('txt-password')
password_textbox.send_keys(password)

login_button = driver.find_element_by_id('btn-login')
login_button.submit()

time.sleep(10)

Call_button = driver.find_element_by_id('newCall')
Call_button.submit()


问题是Call_button没有打开它必须打开的东西。 当它应该打开呼叫拨号框时没有任何反应

Call_button = driver.find_element_by_id('newCall')
Call_button.submit()

您的问题出在这一行Call_button没有将submit()作为参数,因此您需要将其更改为:

Call_button = driver.find_element_by_id('newCall')
Call_button.click()

submit()更改为click()

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM