I'm currently writing a small test webscraper using the python requests and lxml libraries. I'm trying to extract the text from the rows of a table from this site using xpaths to uniquely identify the table. Since the table itself can only be identified by its class name and given the fact that the class name isn't unique, I had to use the parent div element in order to order to specify the table. The table in question is that lists the dates of the season order, filming, and airdates for the show Game of thrones, which I'm trying to select with the following path:
tree.xpath('//div[@id = "mw-content-text"]//table[@class = "wikitable"]//text()')
For some reason, when I print this path in the shell, it returns an empty list. I believe that printing this path would simply display all of the text in the table which I was trying to do in order to ensure I could actually get the contents; however, I would actually need to print each row of the table.
Is there something wrong with this xpath? If so, what is the correct way to go about printing the table contents?