I am trying to scrape data from the table in http://www.oddsportal.com/basketball/usa/nba-2014-2015/results/
The particular table I want has class="table-main"
running from scrapy response.xpath('//table')
In [28]: response.xpath('//table')
Out[28]:
[<Selector xpath='//table' data=u'<table>\n\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t<td c
lass="bol'>,
<Selector xpath='//table' data=u'<table class="table-main top-event">\n\t\t\t'>
,
<Selector xpath='//table' data=u'<table>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td>\n\t\
t\t\t\t\t\t<tab'>,
<Selector xpath='//table' data=u'<table class="rm-bonus-offer">\n\t\t\t\t\t\t\t
\t<'>,
<Selector xpath='//table' data=u'<table>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td>\n\t\
t\t\t\t\t\t<tab'>,
<Selector xpath='//table' data=u'<table class="rm-bonus-offer">\n\t\t\t\t\t\t\t
\t<'>]
does not return the table I wish to scrape. Can anyone help?
Simply use...
or
I managed to get the table by response.xpath('//*[@id="tournamentTable"]')
I've tested, it works.
See Selectors in scrapy doc