I'm using selenium with chromedriver, and getting an error when trying to interact with a specific element.
HTML class code:
<div class="label-31sIdr">Fresh</div>
Selenium Python code:
from selenium import webdriver
import requests
import time
path = '/Users/stryker/Downloads/chromedriver'
driver = webdriver.Chrome(path)
payload = {
'content': "pls pm"
}
header = {
'authorization': 'xxxxx'
}
for i in range (1000):
r = requests.post('https://discord.com/api/v9/channels/991579455376072775/messages', data=payload, headers=header)
time.sleep(1.5)
button = driver.find_element_by_class_name('Fresh')
button.click()
time.sleep(30)
This is the error:
line 19, in <module>
button = driver.find_element_by_class_name('Fresh')
AttributeError: 'WebDriver' object has no attribute 'find_element_by_class_name'
driver.get(url)to open the page you want to clickFreshbutton. And class name islabel-31sIdr.