IMPORTXML: how to scrape NBA logos from a webpage (with Google Sheets)

43 views Asked by At

Webpage: https://www.sportslogos.net/teams/list_by_league/6/National_Basketball_Association/NBA/logos/

Tool: Google Sheets. Function: importxml

Query: I want to retrieve the link of the NBA logos with importxml.

Tries (without any success):

//a[@title='Atlanta Hawks Logos']/@content

//a[contains(@title,'Atlanta')]

How can I do this?

1

There are 1 answers

0
rockinfreakshow On BEST ANSWER

If you need the logo based on team_name:

=image(importxml(A$1,"//*[@title='"&A2&" Logos']//img/@src"))

enter image description here

If you need all the images in one go:

=importxml("Webpage","//img/@src")