Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not Working as expected #4

Open
towfiqi opened this issue Feb 27, 2018 · 3 comments
Open

Not Working as expected #4

towfiqi opened this issue Feb 27, 2018 · 3 comments

Comments

@towfiqi
Copy link

towfiqi commented Feb 27, 2018

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

@epiqueras
Copy link
Owner

Try:

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

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

@towfiqi
Copy link
Author

towfiqi commented Feb 28, 2018

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() ?

@epiqueras
Copy link
Owner

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants