Trouble retrieving numbers using IMPORTXML

Viewed 116

does anyone know how to grab the # of networks (one at a time in each cell) from a list on this page? After trial and error, I think =IMPORTXML("https://www.peeringdb.com/fac/167","//div[@data-filter-value='BGP.Exchange' and @'participants']") should be most "correct," but the formula isn't working...What did I do wrong? Thanks in advance for any help.

enter image description here enter image description here

2 Answers

try:

=QUERY(IMPORTXML(A1, "//div[@class='scrollable']/div"), 
 "select Col3 where Col3 is not null")

enter image description here

Try

=importxml($A$1,"//div[@data-filter-value='"&trim(A2)&"']/../..//div[@class='participants']")

enter image description here

Another solution

=arrayformula(vlookup(trim(A2),trim(importxml(A1,"//div[@class='scrollable']//div")),3,0))
Related