I am trying to use the importxml function in google sheets scrape the MPN (Manufacturer part number) from a website for a list of products (about 2000).
The website: http://gun.deals/search/apachesolr_search/640832007756
The instructions said to use the importxml formula. The link is A1, then used inspector in chrome to copy the xpath. The result:
=IMPORTXML(A1,"//*[@id='content']/div[3]/div[2]/div/div/div/div/div/div[2]/dl/div[2]/dd/a")
(Instructions also said to change double quotes to single around content.)
The error is imported "content in empty" when running the formula. I have tried to make edits and I think the XPath is incorrect. Some say that you can't copy-paste from inspector as the instructions said.
One other thing I tried was =IMPORTHTML(A1, "list", 8)
. This returns UPC and MPN. But it puts the MPN on the second line.
I am new to this and have searched for the last couple of nights for a solution. any help would be much appreciated.
Also Bonus question. What would the formula be to scrape the UPC if we had the MPN? https://gun.deals/search/apachesolr_search/J941PSL9