Tell me more ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I want to import a huge database of products (5000+) to Shopify. My supplier only gave me the website, he refused to give me the database file.

How do I extract the web data to a CSV format so that I can do a bulk import for Shopify?

The CSV format of Shopify: http://www.okah.com/shopify-products.csv

The sample web data that I would like to extract to a CSV: http://www.okah.com

I can do a simple data import on Excel, but it still lacks of a few things:

  1. the detailed description of each product (which is linked from the main table)

  2. the image URL on the last column (excel will only capture the display name of the image link: Pic1, Pic 2, Pic 3 - instead of the image URL)

Can anyone please help?

Thanks.

share|improve this question
http://www.okah.com/shopify-products.csv looks corrupt. It looks to be part of a CSV file with an HTML table dumped in the middle. – Tony Dallimore May 20 '12 at 13:41

closed as not a real question by Nifle, Luke, Indrek, Diogo, Keltari Aug 31 '12 at 3:46

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, see the FAQ.

1 Answer

This is not an answer but is too big for a comment.

Introduction to the requirement

In my experience most tools that import HTML or XML as data ignore the attributes but some of the data you want is held as attributes. For example:

  <a href="xrgEAsgZ8N.jpg"
     title="Orange Cotton&Lace Feathers Printed Fashion T-Shirt"
     rel="lightbox[gal12615]">
     Pic&nbsp;1
  </a>

I have added newlines to the above for easier reading but they are of no significance within HTML. I will assume your knowledge of HTML is nil and explain this.

<a xxxx>yyyy</a> defines an Anchor or hyperlink. xxxx are attributes and yyyy is the value displayed to the user.

In this example yyyy is Pic&nbsp;1. &nbsp; represents non-break-space which means Pic 1 must appear together on one line.

Each attribute is of the form vvv="www".

href="xrgEAsgZ8N.jpg" defines the destination URL. This URL is relative to the web page so the full URL is http://www.okah.com/xrgEAsgZ8N.jpg.

title="Orange Cotton&Lace Feathers Printed Fashion T-Shirt" is for browsers that cater for the visually impaired or cater for devices that cannot display pictures.

rel="lightbox[gal12615]" is a forward link. The definition from the HTML specification is: This attribute describes the relationship from the current document to the anchor specified by the href attribute. The value of this attribute is a space-separated list of link types. lightbox[gal12615] is not a standard link type nor can I discover a definition.

There are other attributes you might want includes the hyperlink from the item code and picture (for example, /12616.html) to a page that contains information like:

Product specification 
Item code     gA4-3841ge 
Gross weight  330 Gram 
Fabric        Cotton&Polyester 
Size          Free  

Obtaining the attribute values

With a fuller understanding the data you need from the HTML page, you may be able to Google for a tool that extracts attribute values.

The example HTML you provide is very simple. A bespoke program in VBA or other language to extract the data you seek would not be difficult to write. To be honest, I think this is the only option; I cannot imagine a general tool that could extract the example CSV file below from the example HTML.

What would you do with this information?

Suppose you could get something like the following:

Item code href,Item code value,Product name
/12616.html,gA4-3841ge,Green Cotton&Lace Feathers ... 
12615.html,gA4-3841or,Orange Cotton&Lace Feathers ...

How are you going to use this? There is little point in getting this data as a CSV file unless you have a plan for using it.

share|improve this answer
Hello, I have HTML knowledge. And I plan to use the extracted data (CSV) file in my Shopify shop. If a custom tool is the only way, I will have to have someone write it. – Help Needed May 21 '12 at 1:19
@Help Needed. Sorry about the html training; I find it is better to insult people's knowledge than baffle them with science. My question about the use the extract file was also clumsy. I obtained what information I could from http://www.okah.com/shopify-products.csv. The information they want does not directly match the information from http://www.okah.com. You would have to follow the link from the item code to get the full set of information. – Tony Dallimore May 21 '12 at 8:00
Even if you could get a tool to extract the data you seek from the html, you would still need a bespoke program to combine that data with the data from the product description page and convert it to the format required by Shopify. However, I would expect a programmer familiar with reading html pages to solve the entire problem in less than a day. Good luck. – Tony Dallimore May 21 '12 at 8:00

Not the answer you're looking for? Browse other questions tagged or ask your own question.