epiqueras/getsy

Not Working as expected

towfiqi opened this issue · 3 comments

Hi,

Thanks for the effort of building such script :)

I am trying to get some html from youtube url. like this:
myGetsy.getMe("#player-api").html()

But its not fetching me anything.

But when I try with contents, I get jquery objects, and not the html:

myGetsy.getMe("#player-api").contents()

My goal is to get the innerHTML of the #player element of any youtube page.

You can test the code here: https://codepen.io/towfiqi/pen/wyQZWo

Many Thanks

Try:

myGetsy.getMe("#player-api")[0]

But, it looks like that DOM element has no children, so you'll get an empty string.

Thanks. Its wired that the jquery objects has the innerHTML content but not when used this method: myGetsy.getMe("#player-api")[0] Is there any way to extract the data from the jQuery object that I got using contents() ?

I'm not sure what you mean. When I visit that URL and inspect the DOM on Chrome's Dev Tools, '#player-api' is in fact an empty div.

screen shot 2018-02-27 at 9 45 17 pm