user14286902
user14286902

Reputation:

Trying to Scrape a Web using google import function

I have been trying to get a details of a website https://uniworthshop.com/shirts.

I am looking for the information are "shirt Name", "Prices" but do not know how to add further to get the prices via import function.

Here is the sheet link. https://docs.google.com/spreadsheets/d/1ZCrQlBjfMmO9636npMth9ErDr4kSnK8LhKb7JXS2KxU/edit#gid=0

can someone please guide or share a script to do this thing.

Upvotes: 0

Views: 74

Answers (2)

nabais
nabais

Reputation: 2037

you can do the following:

  • on cell A1: =IMPORTXML("https://uniworthshop.com/shirts","//div[starts-with(@class, 'product-name')]")
  • on cell A2: =IMPORTXML("https://uniworthshop.com/shirts","//div[@class='product-price']")

References:

Upvotes: 2

Nastor
Nastor

Reputation: 638

By checking that page source html, it seems that <div class="product-name"> and <div class="product-price"> are the two tags holding the information you need. Your best course would be to use Selenium, in this case with Python, and extract innerText from those two tags by searching elements by class, or you could just use requests module to get the full html and subsequently parse it with BeautifulSoup or something else.

Upvotes: 0

Related Questions