Undefined is not a function on a valid function

I’m writing a scraper, as a test I went to on IMDB and tried to get out some actor names from a list here is a link to the page.

I’m trying to grab out the name out from the html when I call this function in the console

$('.list_item').find('.info a:eq(0)').each(function (){ console.log(this)})

The console will log everything in the tag, however when I try to grab out the html I get an error undefined is not a function.

$('.list_item').find('.info a:eq(0)').each(function (){ console.log(this.html())})

However if I give their tag an id I can grab it out with


This grabs out the correct name






The method .html() expects a jQuery object. You need to wrap this -> $(this).