0

I'm currently trying to build a bot to automatically vote on google forms. Problem is, My bot can't click the submit button. It clicks on the button to select the vote, but not the submit button. No error occurs, the button simply doesn't get clicked.

Here is my current code:

from selenium.webdriver.common import action_chains
from selenium.webdriver.common.action_chains import ActionChains
import time

PATH = "C:\Program Files (x86)\chromedriver.exe"
driver = webdriver.Chrome(PATH)
driver.get("{not posting link for privacy}")

time.sleep(5)

vote = driver.find_element_by_id("i92")
submit = driver.find_element_by_xpath('//*[@id="mG61Hd"]/div[2]/div/div[3]/div/div/div/span/span')

actions = ActionChains(driver)
actions.click(vote)
actions.click(submit)
actions.perform()

print('submit' + str(submit))

Any help is appreciated!

3
  • Why are you using an action chain? Commented Jul 18, 2021 at 4:12
  • Am I not supposed to? How do I not use one? Commented Jul 18, 2021 at 4:34
  • 1
    Just use vote.click() and submit.click() Commented Jul 18, 2021 at 4:53

1 Answer 1

0

im not sure why you dont just use submit.click()

something like this :

    app2 = driver.find_element_by_xpath("blah blah blah")
    app2.click()

you can also send keys by

app2.send_keys("hello there") or app2.send_keys(Keys=RETURN) #"enter"
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.