Quantcast
Channel: Active questions tagged selenium - Stack Overflow
Viewing all articles
Browse latest Browse all 97788

Script will not locate Twitter's password field

$
0
0

In this super basic python script using Selenium, I am just trying to automate my twitter login so I can begin scraping. When the chrome session opens, the username is filled out, but the password field is left blank.

import bs4
from selenium import webdriver

driver = webdriver.Chrome();
url = "https://twitter.com/login"
driver.get(url)
assert "Twitter" in driver.title

username = driver.find_element_by_class_name('js-username-field')
username.send_keys('example_username')


password = driver.find_element_by_class_name('js-password-field')
password.clear()
password.send_keys('exmaple_password')

login_button = driver.find_element_by_css_selector("button.submit.EdgeButton.EdgeButton--primary.EdgeButtom--medium")
login_button.submit()

Viewing all articles
Browse latest Browse all 97788

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>