Skip to content

Instantly share code, notes, and snippets.

@rahim42324
Last active October 10, 2020 05:28
Show Gist options
  • Select an option

  • Save rahim42324/04003b764df09f1d063d41f3d821b6a9 to your computer and use it in GitHub Desktop.

Select an option

Save rahim42324/04003b764df09f1d063d41f3d821b6a9 to your computer and use it in GitHub Desktop.
from selenium import webdriver
from selenium.webdriver import ActionChains
import time
driver=webdriver.Chrome("chromedriver.exe")
driver.get("https://twitter.com/login")
time.sleep(3)
driver.find_element_by_xpath("//input[@name='session[username_or_email]']").sendkeys("type username")
driver.find_element_by_xpath("//input[@name='session[password]']").sendkeys("type password")
driver.find_element_by_xpath("//div[@data-testid='LoginForm_Login_Button']").click()
time.sleep(3)
driver.find_element_by_class_name('DraftEditor-root').click()
element=driver.find_element_by_class_name('public-DraftEditorPlaceholder-root')
ActionChains(driver).move_to_element(element).send_keys("hello world").perform()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment