Home > Net >  Is there a way to import images from a Wiki table into a spreadsheet?
Is there a way to import images from a Wiki table into a spreadsheet?

Time:02-11

I'm trying to import a MediaWiki table from here: a google spreadsheet displaying information about hot wheels. the photo column is blank.

Is there anything I can do here? I would be alright if, at the very least, I could pull the link to the photo to put there if I can't pull the photos themselves.

CodePudding user response:

In this case IMPORTHTML can't access links or images that's why the images are not retrieved when calling the function, a solution could be that you call the image directly by using the enter image description here

to get whole table use:

=INDEX({SUBSTITUTE(ARRAY_CONSTRAIN(
 IMPORTHTML(A1, "table", 1),  9^9, 4), "*", ), 
 ARRAY_CONSTRAIN({"Photo"; IMAGE(QUERY(
 IMPORTXML(A1, "//a/@href"), 
 "where Col1 contains 'images'"))}, 448, 1)})

enter image description here

  • Related