Having trouble selecting some specific xpath... (html table, scrapy, xpath) -


i'm trying scrape data (using scrapy) tables can found here:

http://www.bettingtools.co.uk/tipster-table/tipsters

my spider functions when parse response within following xpath:
//*[@id="imagetable"]/tbody/tr

every table on page shares id, i'm grabbing table data.

however, want table data current month (tables in right column).

when try , more specific xpath, invalid xpath error though seems correct. i've tried:

 - //*[@id="content"]/[contains(@class, "column2")]/[contains(@class, "table3")]/[@id="imagetable"]/tbody/tr  - //*[@id="content"]/div[contains(@class, "column2")]/div[contains(@class, "table3")]/[@id="imagetable"]/tbody/tr  - //*[@id="content"]/div[2]/div[1]/[@id="imagetable"]/tbody/tr 

also, when try select xpath of specific table on page chrome //*[@id="imagetable"].

am missing obvious here? why 3 above xpath examples i've tried not valid?

thanks

what makes 3 invalid xpath part pattern :

/[predicate expression here] 

above xpath missed select node on predicate applied. should rather looks :

/*[predicate expression here] 

here examples of valid ones :

1. /table[@id="imagetable"] 2. /div[contains(@class, "column2")] 3. /*[contains(@class, "table3")] 

for specific task, can try following xpath selects rows table inside <div class="column2"> :

//div[@class='column2']//table[@id="imagetable"]/tbody/tr 

Comments