Scrape the Brand Name listed on a Website into Google Sheets

censo

Board Regular
Joined
Dec 25, 2015
Messages
161
Office Version
  1. 2013
Platform
  1. Windows
Hello,

I've attempted to use the IMPORTXML function in Google sheets to scrape the Brand Name found on a website but to no avail.

Steps I've taken include:

1. Copy the URL of the website and paste into cell A1, which is: https://www.samsclub.com/p/hormel-chili-no-beans-6-15-oz/159946
2. On the website, I right-click, then Inspect Element
3. I press the key combination CTRL+SHIFT+C to activate selector mode
4. I clicked on "by Hormel" which is right underneath the main title of the product. This step identifies where in the code this element exists.
5. I right click on this element <span class="sc-product-header-item-number">by Hormel</span>, then Copy, then select Copy XPath and that yields //*[@id="main"]/div/div/div[1]/div/div[2]/div[2]/div/span[1]
6. I enter the following function into cell B1: =IMPORTXML(a1,"//*[@id="main"]/div/div/div[1]/div/div[2]/div[2]/div/span[1]") and I get #ERROR!

Based on instructions I've seen online, I believe I have the right steps and syntax, what am I missing?

TIA
 

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.

Forum statistics

Threads
1,215,003
Messages
6,122,655
Members
449,091
Latest member
peppernaut

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top