1

New here, and still trying to wrap my mind around this importXML tool in Google Sheets. Seem to be able to get it to work on certain websites, but when data is deeply embedded in code, I struggle.

Goal: To pull in weight of items listed on bricklink.com to a Google Sheet.

Link to my Google Sheet: https://docs.google.com/spreadsheets/d/1_vhCkEJXofxMj1Cg117RgPJSFTqPF0ijo_f60mDR6MU/edit?usp=sharing

When I copy the xpath from the source code on the site, I'm given this value: //*[@id="item-weight-info"].

The existing fomula I have is: =IMPORTXML(D2,"//*[@id='item-weight-info']") D2 Contains the web address where it concatenates the website + the item number.

Error I'm receiving is: "Could not fetch url: https://www.bricklink.com/v2/catalog/catalogitem.page?S=21318"

I did come across a potential JSON solution, set up a JSON function in the sheet, but have never written a script before. Tried to copy a script, and tweak as needed, but still no luck.

Is there an easier way to do this that I'm overlooking?

Any guidance or suggestions would be greatly appreciated. Thank you for your time!

  • 3
    You may want to have a look at this similar question: https://stackoverflow.com/questions/61027957/google-sheet-use-importxml-error-could-not-fetch-url – kirkg13 Nov 22 '20 at 22:24

0 Answers0