0

I am trying to get the element of the individual candles on a tradingview.com chart. specifically they x and y coordinates. Problem is using inspector I cannot get the individual candles to show as their own element.

I am aware of using

location = element.location

which if the element were the candle I could get But cant locate the xpath to individual candles

Any help ? Thanks

link

Druta Ruslan
  • 7,171
  • 2
  • 28
  • 38
Logan Thompson
  • 29
  • 1
  • 1
  • 5

1 Answers1

1

It looks like the stock chart is an element from Canvas type:

enter image description here

As you can notice, the content appears at the DOM as a whole, and you cannot track any child elements such as candles. To make further analysis of the Canvas, I advise to take a snapshot of it in your code using open-source library like ashot, and for python look at this solution. Then you would be capable of inspecting the candles by their RGB code within the image, as well as getting their coordinates.

AutomatedOwl
  • 1,039
  • 1
  • 8
  • 14