-3

I wanted to know if there was a way to automatically take snapshots of tradingview charts of particular stocks from a list on google sheets and save these into google documents every day?

From my understanding, it is possible using Python/Selenium but I'm not sure where to start. Can someone please direct me to some useful resources?

All responses are appreciated

Dheeraj Kumar
  • 410
  • 6
  • 16
Tauseef
  • 45
  • 1
  • 6
  • basically, if you put it down to small steps, you will find out your solution ... Here on stackoverflow, we expect you to provide a code and not to ask how to solve XY Problem , anyways ... what I would try is that I would go to a website, I would send keys for screenshot and then sendkeys into google drive :) – StyleZ Mar 08 '19 at 16:27

1 Answers1

0
    import time
    from selenium import webdriver
    from selenium.webdriver.common.keys import Keys
    from selenium.webdriver.common.action_chains import ActionChains
    from selenium.webdriver.support.ui import WebDriverWait
    from selenium.webdriver.support import expected_conditions as EC1
    from selenium.webdriver.common.by import By

    driver = webdriver.Chrome('E:\\Driver\\chromedriver.exe') # change as per your location
    driver.get ("https://in.tradingview.com/chart/?symbol=NSE%3ASBIN")

    driver.maximize_window()

    ActionChains(driver).key_down(Keys.ALT).send_keys('s').perform()
    wait_time = 25 # a very long wait time
    element = WebDriverWait(driver, wait_time).until(EC1.element_to_be_clickable((By.LINK_TEXT, 'Save image')))
    element.click()
    time.sleep(3)
    driver.close()

My aim was not to send it on google drive. Hope you can work ahead.