Giter Club home page Giter Club logo

trading212api's Introduction

Hey! I'm Ben Timor! :)

I'm a full-stack developer from Israel Israel Flag.

If you're interested in my resume, you can check it out on my website or find me on LinkedIn.

  • I mostly work with JavaScript and TypeScript. And I know what you're thinking โ€“ JavaScript is the worst language ever. But hey, Hebrew is worse, and if I could master it by the age of 3, JavaScript is a piece of cake now.
console.log("Hey, Whassup?");
  • On the backend, I'm a NodeJS guy. For the frontend, it's usually React these days, though I'm also a big fan of Svelte.
<Message> Hey! :) </Message>
  • Python was my first love in programming. It's straightforward, intuitive, and just plain fun. If someone asks me, "What language should I learn?", I tell them English first. If they already know English, then Python's the answer.
print("It's so amazing I can just write 'print' and use it!")
  • I'm also into Rust. It's a fantastic language, and I hope more companies start adopting it. Though, I'm not that deep into low-level stuff.
println!("I think I'm in love with macros.");

A bit about my projects

CCL (Compact Console Log) is a Visual Studio Code extension designed to simplify debugging in JavaScript and TypeScript by streamlining console logging.

Quick Overview:

  • Highlight the code you want to log.
  • Press Ctrl + Alt + L to log your selected code to the console.
  • Execute your code and observe the output in the console.
  • To remove the log, just press Ctrl + Alt + L on the logged statement. You can also remove all logs at once by pressing Ctrl + Alt + K.

Straw has only two goals.

  1. I wanted a project that was easy enough to get into a new programming language, but advanced enough to actually learn something.

Straw is an HTML template engine that lets you create HTML pages dynamically. The Straw language is very similar to modern programming ones but simpler and sometimes borrows features from others.

  1. I needed a template engine for my Flask projects. Plain HTML can be a real headache.

Qeres is a new way to create web APIs, designed to be flexible, beginner-friendly, and fast.


Iโ€™ve got a bunch more projects. Check out my repositories to see them all.

How to reach me? message

Feel free to shoot me an email: [email protected]

trading212api's People

Contributors

bentimor avatar pauliusu avatar peterferguson avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

trading212api's Issues

Uses the old web app api & has no option to switch to the old app.

setup method fails on a timeout after login since to account-menu-button is no longer a CSS element in the new app.

# Waiting and opening the user menu to avoid the 'You're using CFD' message.
        elem = WebDriverWait(self.driver, self.timeout).until(expected_conditions.element_to_be_clickable((By.CLASS_NAME, "account-menu-button")))
        force_click(elem)

A simple solution (as an intermediary to switching to new api) would be to use the Switch to the old app button as part of setup. The HTML for the button is

<div class="account-menu-item switch-to-old">
  <div class="svg-icon-holder advanced-mode-icon">
    <svg width="32" height="32" viewBox="0 0 32 32">
      <g fill="none" fill-rule="evenodd">
        <path
          fill="#6F6F7F"
          fill-rule="nonzero"
          d="M-0.396446563,2.89644657 C-0.591708707,2.70118442 -0.908291196,2.70118442 -1.10355334,2.89644656 C-1.29881549,3.09170871 -1.29881549,3.4082912 -1.10355335,3.60355334 L3.75000004,8.45710674 L8.60355335,3.60355335 C8.79881549,3.4082912 8.79881549,3.09170871 8.60355335,2.89644657 C8.4082912,2.70118442 8.09170871,2.70118442 7.89644657,2.89644657 L3.75000004,7.04289317 L-0.396446563,2.89644657 Z"
          transform="matrix(0 -1 -1 0 21.354 20.354)"
        ></path>
        <circle cx="16.5" cy="16.5" r="11" stroke="#6F6F7F"></circle>
      </g>
    </svg>
  </div>
  <div class="label">Switch to the old app</div>
</div>

or xpath

/html/body/div[1]/div[10]/div/div/div/div/div/div/div[9]

or css selector

div.account-menu-item:nth-child(9)

or css path

html body div#app.en div.css-cdrhz6.dropdown-animation-enter-done div div.css-p7lmf6.bottom.right.reverse.dropdown-items.account-menu div.dropdown-items-content div.css-1fbss72.scrollable-area-wrapper.bottom div.css-u0d0cr.scrollable-area div.scrollable-items div.account-menu-item.switch-to-old

Recent redesign broke API?

New user here, did not use API before T212 redesigned website, so can't be sure that is why API fails for me - whenever I try to get the result of a ticker, I get error:

r = act.result("USCR")
File "/home/user1/.local/lib/python3.8/site-packages/Trading212/api.py", line 179, in result
return float(self.position_info(stock, "ppl"))
File "/home/user1/.local/lib/python3.8/site-packages/Trading212/api.py", line 188, in position_info
return self.driver.find_elements_by_xpath(
IndexError: list index out of range

I did a little experimenting with api.py, and noticed that the section with this label is throwing an exception:

# Navigate to the old app if the new app is opened by default

So, maybe API is ending up on the new site, and can't get to the "old" site? Makes sense that that breaks the code. But the pre-redesign site is still available, at https://live.trading212.com/legacy. But I don't know Selenium to experiment.

HELP

hey guys, can someone help me make this script to work?

login not working anymore

the login page now uses email and password fields identified by name
instead of id (as the script is written)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.