I am dipping my fingers in webscraping, and I am trying to scrape the Queensland Lobbyist Registers and the links within the main register using Scrapy. Each lobbyist has a link that can be followed to get their clientele list (for example, Antinomies and Australian Public Affairs; however, these nested tables are not consistent within each page.
For Antimonies, for example, the xpath for clients is //[@id="main"]/table[7], and it starts at row 20, and for the APF*, it's //*[@id="main"]/table[6], and starts at row 24. The common thing is that both client subtables come under this row:
"Client/s on whose behalf lobbying activity is, or may be, conducted"
Is there a way that Scrapy can be coded to read rows only after specific rows for each page?
I have been using the following:
tableclients = response.xpath('//*[@id="main"]/table[7]//tbody')
rowclients = tableclients.xpath('//tr')