Hello i try to use selenium for making a botnet for my cybersecurity work for my school but it show this error i use gecko ( Firefox ) driver
i got this error : Error with proxy 217****:50100:steixv:T*fZwpn3: ‘WebDriver’ object has no attribute ‘find_element_by_name’
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
import time
# List of proxies with credentials in the format IP:Port:Username:Password
proxy_list = [
"ip:port:username:password",
# Add more proxies as needed
]
# Function to set proxy and initialize WebDriver
def set_proxy(proxy):
ip_port_user_pass = proxy.split(':')
ip = ip_port_user_pass[0]
port = ip_port_user_pass[1]
username = ip_port_user_pass[2]
password = ip_port_user_pass[3]
options = webdriver.FirefoxOptions()
# Configure proxy settings
options.add_argument('--proxy-server=http://{}:{}'.format(ip, port))
# Set proxy authentication credentials
options.add_argument('--proxy-auth={}:{}'.format(username, password))
# Set Firefox to use the options
driver = webdriver.Firefox(options=options)
return driver
# Function to fill out and submit the form
def fill_form(driver):
driver.get('http://127.0.0.1:5000') # Replace with your actual form URL
# Locate form elements and fill them out
name_field = driver.find_element_by_name('name')
name_field.send_keys('John Doe')
email_field = driver.find_element_by_name('email')
email_field.send_keys('[email protected]')
# Submit the form
submit_button = driver.find_element_by_xpath('//input[@type="submit"]')
submit_button.click()
# Wait to see the result
time.sleep(2)
# Loop through proxies and submit the form
for proxy in proxy_list:
try:
driver = set_proxy(proxy)
fill_form(driver)
driver.quit()
except Exception as e:
print(f'Error with proxy {proxy}: {e}')
print('Form submission completed.')
i try to use chatgpt but even him cant solve my problem