Giter VIP home page Giter VIP logo

Comments (1)

mwpenny avatar mwpenny commented on July 21, 2024

I see - so you'd perform your search on Kijiji, configure everything you want, and then just use that URL with this module?

That would be nice but it wouldn't work with the mobile API-based scraping (default) since 1) the URLs are completely different and 2) the query string parameter names in the URL don't all match up with the API parameter names, so there would have to be a hard-coded mapping from one set of parameter names to another which breaks down if Kijiji ever adds, removes, or changes parameters.

It's also already possible to use the location filtering with the module's current API:

const kijiji = require("kijiji-scraper");

const params = {
    locationId: kijiji.locations.QUEBEC.GREATER_MONTREAL.CITY_OF_MONTREAL,
    categoryId: kijiji.categories.REAL_ESTATE.APARTMENTS_AND_CONDOS_FOR_RENT,
    distance: 3  // Kilometers
};

kijiji.search(params);

You can specify the base location using the zipcode (works with postal code), address, or longitude/latitude parameters. By default it just uses whatever location you specify for locationId. Note that this is for API scraping. For HTML, use radius instead of distance. If you're using HTML scraping, you can find other parameters by inspecting the HTTP request when searching (look for the request to b-search.html).

So for these reasons I'm going to close this. The goal of the module is to abstract away the underlying API and provide a way to query it programmatically - agnostic of how Kijiji does things on their end. This approach is what allowed easy integration of the mobile API backend alongside the HTML one.

If there's a search that you can do on Kijiji that you can't do with this module, please open another issue.

from kijiji-scraper.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.