Skip to content

TradingView Python Scraper (Pulls Live Data using 10sec Bot)

License

Notifications You must be signed in to change notification settings

Braxt0nAI/tradingview-python-scraper

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

tradingview-scraper 2020

Install imports

pip install -r requirements.txt

Run

python main.py

Want to add something? file a PR and join this discord

https://discord.gg/pEssYdtXZx


Have a tradingview username and password?

credits: euvgub

def get_auth_token():
    sign_in_url = 'https://www.tradingview.com/accounts/signin/'
    username = 'username'
    password = 'password'
    data = {"username": username, "password": password, "remember": "on"}
    headers = {
        'Referer': 'https://www.tradingview.com'
    }
    response = requests.post(url=sign_in_url, data=data, headers=headers)
    auth_token = response.json()['user']['auth_token']    
    return auth_token

Then send a message through the tunnel sendMessage(ws, "set_auth_token", ["auth_token"])

ws = create_connection( 'wss://data.tradingview.com/socket.io/websocket?from=chart/XXyour_chartXX/&date=XXXX_XX_XX-XX_XX',headers=headers)

result = ws.recv()
if re.search('~m~\\d+~m~~h~\\d+', result):
            #Send ping message
            ws.send(result)

Buy Me A Coffee

About

TradingView Python Scraper (Pulls Live Data using 10sec Bot)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Jupyter Notebook 50.1%
  • Python 49.9%