【发布时间】:2020-09-09 15:29:34
【问题描述】:
一切正常,但发送部分不起作用。 click() 在硒中不起作用
from selenium import webdriver
import time
driver = webdriver.Chrome(executable_path="D:/Python/Python/python/chromedriver_win32/chromedriver.exe")
driver.get("https://web.whatsapp.com/")
time.sleep(10)
name = input('Enter the name of user or group : ')
msg = input('Enter the message : ')
count = int(input('Enter the count : '))
user = driver.find_element_by_xpath('//span[@title = "{}"]'.format(name))
user.click()
msg_box = driver.find_element_by_class_name('_3uMse')
for i in range(count):
msg_box.send_keys(msg)
button=driver.find_element_by_class_name('_1JNuk')
button.click()
【问题讨论】:
-
您可能希望使用
wedriverwait让页面在您点击之前加载:stackoverflow.com/questions/26566799/…
标签: python python-3.x selenium