When I visit this website, I come across a chart.
I am able to locate the chart boundaries element using
//div[@data-chart_id='product_cannabinoids']
, but I cannot find the rect
, svg
, or g
elements inside it.Even though I can see these elements in the
F12
developer tool, searching for //div[@data-chart_id='product_cannabinoids']//svg
or //div[@data-chart_id='product_cannabinoids']//rect
does not yield any results.It seems like these elements might be generated dynamically with JavaScript, but they do not behave like pseudo elements, they appear to be regular elements!
Can anyone explain why this occurs and suggest a reliable method to locate these elements using Selenium?