I'm new to XPath and having trouble retrieving the Facility and City data from a table. My intention is to get the four facility names and their cities from the bottom left table on this
CodePudding user response:
With xpath 1.0, you can probably only do something like this:
Assuming your url is in A1, enter in B1
=IMPORTXML(A1,"//div[@id='list-facilities']//div[@class='row item']//div[@class='facility']")
and in B2
=IMPORTXML(A1,"//div[@id='list-facilities']//div[@class='row item']//div[@class='city']")
You should get
Cogeco Peer 1 Vancouver 21 North Vancouver
Cologix VAN2 Vancouver
Cologix VAN3 Vancouver
Harbour Centre Vancouver Vancouver
which is close to what I think you are after.