IMPORTXML find path containing text, return string

Viewed 21

objective - search the GPS map on this page and extract coordinates of player

purpose to create a tracker that will periodically record location of player to google sheets

https://test2.dfprofiler.com/profile/view/13369005


full map /html/body/div/div/div[3]/div/div[2]/div/div/table/tbody

row /html/body/div/div/div[3]/div/div[2]/div/div/table/tbody/tr[1]

square /html/body/div/div/div[3]/div/div[2]/div/div/table/tbody/tr[1]/td[1]


setup is full grid map>rows>squares (data in squares)


each square contains < td class="coord x1001 y981" title="">


I want to search all squares for one that contains "playerlocation", then return that string

< td class="coord x1054 y987 secronomBunker playerlocation" title="" >< /td >


next step is to extract only the "x#### y####" coordinates but im good to go after i can figure out how to use "contains" right

1 Answers

try:

=REGEXEXTRACT(QUERY(FLATTEN(IMPORTDATA(A1)), 
 "where Col1 contains 'secronomBunker'", ), "(x\d+ y\d+)")

enter image description here

Related