Skip to content

Instantly share code, notes, and snippets.

@vikranth22446
Created September 10, 2018 18:05
Show Gist options
  • Save vikranth22446/426aaff498712959186739c367344ab2 to your computer and use it in GitHub Desktop.
Save vikranth22446/426aaff498712959186739c367344ab2 to your computer and use it in GitHub Desktop.
Selenium script to fill a google form
# Instructions: pip install selenium requests & brew install geckodriver.
import requests
from selenium import webdriver
tinyurl = "INSERT_EXTENSION"
resp = requests.get("http://tinyurl.com/{}".format(tinyurl))
# use chrome via driver = webdriver.Chrome()
driver = webdriver.Firefox()
driver.get(resp.url)
full_name = "INSERT_FULL_NAME"
sid = "INSERT_YOUR_SID"
js = """
document.querySelectorAll("div.quantumWizTogglePaperradioEl.docssharedWizToggleLabeledControl.freebirdThemedRadio.freebirdThemedRadioDarkerDisabled.freebirdFormviewerViewItemsRadioControl")[0].click();
document.querySelectorAll("div.quantumWizTogglePaperradioEl.docssharedWizToggleLabeledControl.freebirdThemedRadio.freebirdThemedRadioDarkerDisabled.freebirdFormviewerViewItemsRadioControl")[2].click();
document.querySelectorAll("input.quantumWizTextinputPaperinputInput")[0].value = "{full_name}";
document.querySelectorAll("input.quantumWizTextinputPaperinputInput")[1].value = "{sid}";
document.querySelectorAll("input.quantumWizTextinputPaperinputInput")[2].value = FB_PUBLIC_LOAD_DATA_[1][1][4][4][0][4][0][2][0];
""".format(full_name=full_name,sid=sid)
driver.execute_script(js)
@gidoBOSSftw5731
Copy link

could you explain how to get your SID?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment