I need a some help in getting a ImportXML command to return the result I'm looking for. I'm using Google Sheets. This is the website: https://www.foresteu.com/butorajtok-es-tartozekaik/tomorfa/trieste/10000520000-tomorfa-trieste-116x146mm-mez
This xpath works, but it is way too long: //div[contains(@class, 'col-xs-120 nopad')]/div[contains(@class, 'col-xs-120 nopad')][2] | //div[contains(@class, 'col-xs-120 nopad')]/div[contains(@class, 'col-xs-120 nopad')][3] | //div[contains(@class, 'col-xs-120 nopad')]/div[contains(@class, 'col-xs-120 nopad')][4] | //div[contains(@class, 'col-xs-120 nopad')]/div[contains(@class, 'col-xs-120 nopad')][5] | //div[contains(@class, 'col-xs-120 nopad')]/div[contains(@class, 'col-xs-120 nopad')][6] | //div[contains(@class, 'col-xs-120 nopad')]/div[contains(@class, 'col-xs-120 nopad')][7]
Can i make it shorter? I can't find a shorter xpath which works.
How about this xpath? I think that there might be more simple xpath. So please think of this as one of several answers.
//div[@class='col-xs-120 nopad'][./span]
https://www.foresteu.com/butorajtok-es-tartozekaik/tomorfa/trieste/10000520000-tomorfa-trieste-116x146mm-mez
is put in "A1".
=IMPORTXML(A1,"//div[@class='col-xs-120 nopad'][./span]")
//div[@class='col-xs-120 nopad']
means div
that class
is col-xs-120 nopad
.[./span]
means div
which have span
under div
.If this was not what you want, I'm sorry.