-1

In this url: http://es.finance.yahoo.com/q/cp?s=%5EJKSE If I test this selector expresion in the console...

 $('#yfncsumtab .yfnc_tableout1 tr td table tbody') 

...it returns html table (but not in an array):

 <table>...</table>

Can anybody explain me why I am not obtaining an array contaning the html table??? That's the reason why I cannot apply .each(), .text() ... I think.

When I test the same selector to another website's table it always returns:

 [<table>...</table>]

And with that response, I can apply .each() o whatever jQuery method.

AlexAcc
  • 601
  • 2
  • 10
  • 28

2 Answers2

0

Type jQuery in the console and you'll see it's undefined.

So what's that $ then?

What is the dollar sign in Javascript, if not jQuery

Community
  • 1
  • 1
Stefan Kendall
  • 66,414
  • 68
  • 253
  • 406
  • Thank you so much, I didn't know that without jquery implemented in the website I could'nt use it to parse the html. I will try with javascript directly, that's the problem for sure. – AlexAcc Mar 02 '15 at 14:28
0

Since there is no JQUERY in the web page, you can use the following to loop through:

document.getElementsByClassName("yfnc_tableout1")[0].getElementsByTagName("table")[0].getElementsByTagName("tr")
ArinCool
  • 1,720
  • 1
  • 13
  • 24