Discussions » Development

I get undefined class value

§
Posted: 2016-12-10

I get undefined class value

Hi

I'm trying to get class value but i get undefined

I'm trying to get class qZpD9d Text Content
Who contains Total Videos Uploaded Number for this channel = 6357 videos so far

6357 videos

Go to any youtube Video and mouse hover on channel name it will popup small window contain Total Videos Uploaded Number for this channel

https://www.youtube.com/watch?v=jNw4G4sBgYI

class name it's the same for me for every Video i open Maybe the class name changed for every region

See this image for more info

https://i.imgsafe.org/c55f39c938.jpg

My script is


var Total = document.querySelector('.qZpD9d').textContent;

alert(Total);

§
Posted: 2016-12-12

maybe it is because the dialog you want to access is loaded dynamically and does not exist when you run your script.

Post reply

Sign in to post a reply.