GithubHelp home page GithubHelp logo

serverlxss / deno-supabase-puppeteer-browserless-olx-scraping Goto Github PK

View Code? Open in Web Editor NEW
1.0 0.0 1.0 3 KB

Open-source Deno-based Puppeteer web scraper uses Browserless.io to scrape OLX, storing data in Supabase. Fast, efficient, and customizable

TypeScript 100.00%

deno-supabase-puppeteer-browserless-olx-scraping's Introduction

OLX Web Scraper

This is a Deno application that uses Puppeteer to scrape data from the OLX website and return the sorted list of cars based on a custom function.

Getting Started

  1. Install Deno: https://deno.land/manual/getting_started/installation
  2. Clone the repository: git clone https://github.com/your-username/olx-web-scraper.git
  3. Navigate to the project directory: cd olx-web-scraper
  4. Run the application: deno run --allow-net --allow-env index.ts

Configuration

This application uses the Browserless.io service to run headless Chrome. In order to use this service, you need to set the BROWSERLESS_TOKEN environment variable to your Browserless API token.

Alternatively, you can set a default token in the BROWSERLESS_TOKEN_EXAMPLE variable in the code.

Usage

Once the application is running, it will scrape the OLX website for cars and return a sorted list of cars based on the weight function, which calculates a custom score for each car based on its year, mileage, and price.

The application returns a JSON response with the following format:

{
  "data": [
    {
      "name": "Honda Civic 2018",
      "address": "São Paulo, SP",
      "year": "2018",
      "km": "50.000",
      "price": "R$ 80.000",
      "picture_url": "https://example.com/car.jpg",
      "url": "https://www.olx.com.br/anuncio/honda-civic-2018-ID12345.html"
    },
    ...
  ]
}

If the application encounters an error, it will return a JSON response with the following format:

{
  "status": "error",
  "message": "Failed to scrape data"
}

Contributing

Feel free to submit pull requests or open issues for any bugs or feature requests.

deno-supabase-puppeteer-browserless-olx-scraping's People

Contributors

cassianodaniel avatar

Stargazers

Helton Quintãns avatar

Forkers

scrxped

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.