open chrome and go to reddit.com/user/me in python

Here is the code to achieve the above task:

main.py
from selenium import webdriver

# set path for chromedriver.exe
driver = webdriver.Chrome("path/to/chromedriver.exe")

# go to website
driver.get("https://www.reddit.com")

# find login button
login_button = driver.find_element_by_xpath("//a[@data-click-id='header_login']")

# click on login button
login_button.click()

# find username field and enter the value
username = driver.find_element_by_id("loginUsername")
username.send_keys("yourusername")

# find password field and enter the value
password = driver.find_element_by_id("loginPassword")
password.send_keys("yourpassword")

# submit the form
submit_button = driver.find_element_by_xpath("//button[@type='submit']")
submit_button.click()

# navigate to user profile
driver.get("https://www.reddit.com/user/me")
772 chars
29 lines

gistlibby LogSnag