Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import pandas as pd
- from selenium import webdriver
- from selenium.webdriver.chrome.options import Options
- from selenium.webdriver.common.keys import Keys
- from selenium.webdriver.common.by import By
- from selenium.webdriver.support.ui import WebDriverWait
- from selenium.webdriver.support import expected_conditions as EC
- from selenium.webdriver.common.action_chains import ActionChains
- from selenium.webdriver.support.ui import Select
- import time
- from getpass import getpass
- options = Options()
- options.add_experimental_option("prefs", {
- "download.default_directory": r"D:\python\officepytho",
- "download.prompt_for_download": False,
- "download.directory_upgrade": True,
- "safebrowsing.enabled": True
- })
- while True:
- print("process started")
- #driver = webdriver.Chrome(chrome_options=chrome_options)
- driver = webdriver.Chrome(executable_path = r"D:\python\officepython\chromedriver.exe",chrome_options=options)
- driver.maximize_window()
- wait = WebDriverWait(driver, 10)
- driver.get("https://www.tradingview.com/")
- time.sleep(2)
- signLine = driver.find_element_by_xpath("//*[@class='tv-header__link tv-header__link--signin js-header__signin']")
- signLine.click()
- time.sleep(2)
- username = driver.find_element_by_name("username")
- password = driver.find_element_by_name("password")
- username.send_keys("Your username here")
- username.send_keys(Keys.TAB)
- time.sleep(.2)
- password.send_keys("Your password here")
- time.sleep(.2)
- password.send_keys(Keys.ENTER)
- input("wait for any key to press")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement