from selenium import webdriver from selenium.webdriver.common.by import By from selenium.webdriver.common.keys import Keys import time # Open browser driver = webdriver.Chrome() driver.get("https://example.com/post") # YOUR OWN WEBSITE / TEST PAGE comment_text = "This is an automated comment" while True: try: # Find comment box comment_box = driver.find_element(By.ID, "comment-box") comment_box.clear() comment_box.send_keys(comment_text) # Click submit button submit_btn = driver.find_element(By.ID, "submit-comment") submit_btn.click() print("Comment posted") # Wait before next comment time.sleep(10) # 10 seconds gap except Exception as e: print("Error:", e) break
Comments
Post a Comment