Last active
October 5, 2020 20:55
-
-
Save fnneves/231b0adb14147d0e3833694e1f183f39 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from selenium import webdriver | |
from selenium.webdriver.common.keys import Keys | |
# Tell Selenium where you installed the chromedriver! | |
chromedriver_path = 'C:/Users/User/Downloads/chromedriver_win32/chromedriver.exe' | |
webdriver = webdriver.Chrome(executable_path=chromedriver_path) | |
# Getting the website through the webdriver | |
webdriver.get('https://www.somewebsite.com/accounts/login/?source=auth_switcher') | |
username = webdriver.find_element_by_name('username') # Similar to how BS works | |
username.send_keys('your_username') | |
password = webdriver.find_element_by_name('password') | |
password.send_keys('your_password') | |
button_login = webdriver.find_element_by_css_selector('button') | |
button_login.click() # Sending a click command to login |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment