Joe Caraccio
Joe Caraccio

Reputation: 2035

Node.js Webscraping Table with Slighly different values

Trying to do some webscraing to return information from this page, and particly this rows in this table. The one issue I see is that each of the row has some sort of a different ID and is slightly different, is there a way to dynamically webscrape these despite the fact that the class is not unique.

enter image description here

Upvotes: 0

Views: 86

Answers (1)

undefined
undefined

Reputation: 2214

Since this is tagged with cheerio, consider the following solution:

// get html somehow...
var $ = cheerio.load(html)
// query all elements with class "evenrow" or "oddrow"
var $elements = $('.evenrow, .oddrow')
// handle $elements

Upvotes: 1

Related Questions