All Collections
Case Tutorial
E-Commerce
Scrape car information from Kijiji
Scrape car information from Kijiji
Updated over a week ago

You are browsing a tutorial guide for the latest Octoparse version. If you are running an older version of Octoparse, we strongly recommend you upgrade because it is faster, easier, and more robust! Download and upgrade here if you haven't already done so!

Kijiji is a Canadian online classified advertising website and part of eBay Classified Group.

This tutorial will show you how to scrape car information from Kijiji.

1.png

To follow through, you may want to use this URL in the tutorial:


The main steps are shown in the menu on the right, and you can download the sample task file here.


1. Go to Web Page - to open the target web page

  • Enter the URL on the home page and click Start


2. Create a "Loop Click Item" - loop click into each item on each list

  • Click on the first item card

  • Click on the second item card

  • Click on Loop click each URL on the Tips panel


3. Modify Xpath for Loop Item - to locate all the items

After setting the Loop for the item cards, some items failed to be included in the Loop. We need to modify the Xpath to locate all the items manually.

  • Click Loop Item

  • Choosing Loop Mode as Variable List

  • Input Xpath as //a[@data-testid="listing-link"]

  • Click Apply


4. Set up Click Item - to show detailed info

Detailed descriptions have been hidden on the detailed page, so we need to click the "Show more" button to load the information fully.

  • Click Show more under the description

  • Click Click button on the tips panel


5. Extract Data - to select the data you want

  • Click on the wanted Data

  • Click Text on the Tips panel

  • Double-click the data field if you need to rename them

DATA.png

6. Modify XPath for data fields - to locate elements accurately in each detailed page

If there is a missing data collection or field misplacement, we need to rewrite XPath to ensure the elements are located for every detailed page.

  • Go to the Data Preview panel

  • Switch to Vertical View by clicking the upper right-corner icon

  • Input Xpath for the field

Please find XPath for each data field below:

Product name: //h1[@itemprop="name"]

Price: //span[@itemprop="price"]

IMG_URL: //div[contains(@class,'backgroundImage')]//img

Address://a[contains(@class,"location")]

Transmission: //span[contains(text(),"Transmission")]/following-sibling::span

Fuel Type: //span[contains(text(),"Fuel Type")]/following-sibling::span

Stock: //span[contains(text(),"Stock")]/following-sibling::span

Drivetrain: //span[contains(text(),"Drivetrain")]/following-sibling::span

Body Type: //span[contains(text(),"Body Type")]/following-sibling::span

Description: //div[@itemprop="description"]


The final workflow should look like this:


7. Run the task - to get the desired Data

  • Click Run to run your task either on your device or in the cloud

  • Select Standard Mode under Run on your device section to run the task on your local device

  • Wait for the task to complete


Here is the sample output data, which can be exported in Excel, CSV, HTML and JSON formats.

Tip: Local runs are great for quick runs and small amounts of data. If you are dealing with more complicated tasks or mass of data, Run in the Cloud is recommended for higher speed. You are welcome to try the premium feature by signing up for the 14-day free trial here. Tasks can be scheduled hourly, daily, or weekly, and data delivered regularly.

Did this answer your question?