Giter VIP home page Giter VIP logo

craigslist-scraper's Introduction

Craigslist Scraper

Oxylabs promo code

Craigslist Scraper is a scraping tool that overcomes advanced anti-bot systems and helps you gather public data from Craigslist on any scale you need. This guide will show you how to scrape Craigslist using Oxylabs’ Scraper API.

How it works

You can get Craigslist data by sending a request to our API with the URLs you want to access and scrape. The API will return the HTML of any public Craigslist page.

Python code example

The below code sample sends a request to our service, which uses a headless browser to execute JavaScript and sends back the HTML of a Craigslist page:

import requests
from pprint import pprint

# Structure payload.
payload = {
   'source': 'universal',
   'url': 'https://berlin.craigslist.org/search/ela#search=1~gallery~0~0',
   'geo_location': 'Germany',
   'render': 'html'
}

# Get a response.
response = requests.request(
    'POST',
    'https://realtime.oxylabs.io/v1/queries',
    auth=('USERNAME', 'PASSWORD'), #Your credentials go here
    json=payload
)

# Instead of response with job status and results URL, this will return the
# JSON response with results.
pprint(response.json())

Visit the documentation to find more payload parameters and other details.

Output sample

{
  "results": [
    {
      "content": "<!doctype html>\n<html lang=\"en\">\n<head>
      ...
      </script></body>\n</html>\n",
      "created_at": "2023-09-21 14:26:52",
      "updated_at": "2023-09-21 14:27:10",
      "page": 1,
      "url": "https://berlin.craigslist.org/search/ela#search=1~gallery~0~0",
      "job_id": "7110630468831163393",
      "status_code": 200
    }
  ]
}

Oxylabs Craigslist Scraper API will ease your scraping processes significantly. Use it to gather public data, such as jobs, items, services, and ads. If you have any questions, feel free to get in touch with us via live chat or email.

Also, check this tutorial on pypi

craigslist-scraper's People

Contributors

augustoxy avatar oxylabsorg avatar

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.