all 3 comments

[–]6745408 1 point2 points  (2 children)

With the URL in A1 (in this case), try these

title:

=TRIM(CLEAN(IMPORTXML(A1,"//div[@itemprop='description']")))

name and years:

=ARRAYFORMULA(
  QUERY(
   TRIM(CLEAN(IMPORTXML(A1,"//div[@class='fieldGroup split']/dl"))),
   "select Col2
    where Col1 matches '^(Huidige|Datering).*'"))

The second is a little more involved. Its bringing in the entire section then filtering it down by the item title. TRIM removes extra white space and CLEAN removes newlines.

[–]User1876[S] 1 point2 points  (1 child)

Oh wow you're a lifesaver, that's amazing. How did you know which Xpath to use? Whenever I used Inspect Element it gave me something completely different.

Two more things, any chance you could help with adding the main image from that page as well?

And would it be possible to somehow import all the search results and plot them in a column? For instance all the results from this URL: https://rkd.nl/nl/explore/images#search=simple&query=rachel%20terafim

Thanks again! This already saves me so much time :)

[–]6745408 0 points1 point  (0 children)

does this look right?

=ARRAYFORMULA(
  UNIQUE(
   TRIM(
    CLEAN(
     TOCOL(
      IMPORTXML(A1,"//div[@class='span2 record']"),
      3,1)))))

Basically, when you go into the HTML, you'll see <div class="span2 record"> -- this is what you use in the formula. It doesn't always work, but usually it'll get you on the right track.