Skip to content

Instantly share code, notes, and snippets.

@kmandana
Last active April 18, 2020 18:23
Show Gist options
  • Select an option

  • Save kmandana/f7443e35cc90ff3697fe0af1fee26bc7 to your computer and use it in GitHub Desktop.

Select an option

Save kmandana/f7443e35cc90ff3697fe0af1fee26bc7 to your computer and use it in GitHub Desktop.
signIn method
def signIn(self):
self.browser.get("https://www.instagram.com")
username_element = WebDriverWait(self.browser, 5).until(EC.presence_of_element_located((By.CSS_SELECTOR, "#react-root > section > main > article > div.rgFsT > div:nth-child(1) > div > form > div:nth-child(2) > div > label > input")))
username_element.click()
username_element.send_keys(self.username)
password_element = self.browser.find_element_by_css_selector("#react-root > section > main > article > div.rgFsT > div:nth-child(1) > div > form > div:nth-child(3) > div > label > input")
password_element.click()
password_element.send_keys(self.password)
password_element.send_keys(Keys.RETURN)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment