I'm using Google Sheet IMPORTHTML() to get the text from a website. I am trying to get the text after a certain search string via IMPORTHTML() in Google Sheet using XPath.
As an example, I would like to extract number of rooms and living space from the websites below
CodePudding user response:
How about modifying your xpath as follows?
Modified xpath:
//p[@class='css-1ush3w6 excbu0j2' and ../..//span[text()='Zimmer']]
Result:
When this modified xpath is used for your 2 URLs, the following result is obtained.
In this sample, the URL and =IMPORTXML(A1, "//p[@class='css-1ush3w6 excbu0j2' and ../..//span[text()='Zimmer']]")
is put to the cells "A1" and "B1", respectively.