dijs / infobox-parser

Parse Wikipedia Infoboxes
40 stars 18 forks source link

Not handling rowspans #34

Open vjpr opened 2 years ago

vjpr commented 2 years ago

https://en.wikipedia.org/w/index.php?title=United_States_presidential_election&action=edit&section=25#Electoral_college_results

Notice year is incorrect, and what is Composition bar compact.

[
  {
    year: 'United States presidential election, 1788–89',
    party: 'Independent (politician)',
    presidentialCandidate: 'George Washington',
    vicePresidentialCandidate: 'None',
    popularVote: '43,782',
    '%': '100.0',
    electoralVotes: 'Composition bar compact',
    notes: ''
  },
  {
    year: 'Federalist Party',
    party: 'John Adams',
    presidentialCandidate: 'N/A',
    vicePresidentialCandidate: 'N/A',
    popularVote: 'Composition bar compact',
    '%': '',
    electoralVotes: undefined,
    notes: undefined
  },
  {
    year: 'John Jay',
    party: 'Composition bar compact',
    presidentialCandidate: '',
    vicePresidentialCandidate: undefined,
    popularVote: undefined,
    '%': undefined,
    electoralVotes: undefined,
    notes: undefined
  },

Or maybe wikijs is incorrectly detecting an "infobox" instead of an "table"...not sure if wikijs handles these or what the difference is yet.