Giter Site home page Giter Site logo

vittoriotriassi / jobs_scraper Goto Github PK

View Code? Open in Web Editor NEW
14.0 1.0 3.0 81 KB

Simple job postings scraper for Indeed based on requests and BeautifulSoup

License: MIT License

Python 100.00%
scraper requests beautifulsoup python web-scraping jobs-scraper

jobs_scraper's Introduction

jobs_scraper

Build Status PyPI Downloads

jobs_scraper is a simple job postings scraper for the website Indeed, it is written in Python and is based on the requests and BeautifulSoup libraries.

Installation

Run the following to install the package:

pip install jobs_scraper

Usage

To use jobs_scraper you need to create a new JobsScraper object and provide the following attributes to its constructor:

  • country: prefix country.
  • position: job position.
  • location: job location.
  • pages: number of pages to be scraped.
from jobs_scraper import JobsScraper

# Let's create a new JobsScraper object and perform the scraping for a given query.
scraper = JobsScraper(country="nl", position="Data Engineer", location="Amsterdam", pages=3)
df = scraper.scrape()

In this way, the first three pages for the example query "Data Engineer" based in "Amsterdam" on the Dutch version of the portal Indeed get scraped. The scrape method returns a Pandas dataframe, therefore it is possible to export it into a csv file.

Additional Parameters

  • max_delay: bearing in mind that this package is meant only for educational purposes, a delay in the requests can be provided. By setting max_delay in the constructor, every job posting will be randomly scraped in an interval between 0 and max_delay seconds.

    scraper = JobsScraper(country="...", position="...", location="...", pages=..., max_delay=5)
  • full_urls: since most of the scraped job urls are pretty long, the returned Pandas dataframe will truncate them, making it not simple to access. Setting full_urls to True, the scraped urls will not be truncated.

    scraper = JobsScraper(country="...", position="...", location="...", pages=..., full_urls=True)

TODO

  • Add rotating proxies to prevent the scraper from being blocked once too many requests are sent.

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.