Git Product home page Git Product logo

fiverr-scraping-api's Introduction

Fiverr API Scraper is a Python library that allows you to extract detailed information from Fiverr gig pages and user profiles. This tool can be used to programmatically gather data from Fiverr gigs and profiles, facilitating analysis and automation of tasks related to Fiverr.

Features

  • Extract detailed information from Fiverr gig pages and user profiles.
  • Dynamic scraping of Fiverr pages, also includes the initial props of the page.
  • Proxy support.
  • Change user-agent or other headers.

Installation

You can install the Fiverr API Scraper using pip:

pip install fiverr-api

Usage

Below are examples of how to use the Fiverr API Scraper to extract data from Fiverr gig pages and user profiles.

Gig Scrape Example

from fiverr_api.scrapers import gig_scrape

# URL of the Fiverr gig you want to scrape
gig_url = "https://www.fiverr.com/some-seller/some-gig-title"

# Scrape gig data
gig_data = gig_scrape(gig_url)

# Print the scraped gig data
print(gig_data)

Profile Scrape Example

from fiverr_api.scrapers import profile_scrape

# URL of the Fiverr profile you want to scrape
profile_url = "https://www.fiverr.com/some-seller"

# Scrape profile data
profile_data = profile_scrape(profile_url)

# Print the scraped profile data
print(profile_data)

Proxy Support

You can use the Fiverr API Scraper with a proxy by setting via actions.set_proxy():

from fiverr_api.utils.actions import actions

# Set proxy
actions.set_proxy({
    "http": "http://username:password@proxy:port",
    "https": "http://username:password@proxy:port"
})

Changing User-Agent or Other Headers

You can change the user-agent or other headers by setting via actions.set_headers():

from fiverr_api.utils.actions import actions

# Set headers
actions.set_headers({
    "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 "
                  "(KHTML, like Gecko) Chrome/80.0.3987.149 Safari/537.36",
    "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,"
              "image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9",
    "Accept-Encoding": "gzip, deflate, br",
    "Accept-Language": "en-US,en;q=0.9",
    "Cache-Control": "max-age=0",
    "Connection": "keep-alive",
    "Host": "www.fiverr.com",
    "Sec-Fetch-Dest": "document",
    "Sec-Fetch-Mode": "navigate",
    "Sec-Fetch-Site": "none",
    "Sec-Fetch-User": "?1",
    "Upgrade-Insecure-Requests": "1"
})

# Set user-agent specifically
actions.set_user_agent("Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 "
                       "(KHTML, like Gecko) Chrome/80.0.3987.149 Safari/537.36")

# Get headers with actions.headers
print(actions.headers)

Project Structure

The Fiverr API Scraper is organized into several modules to enhance code readability and maintainability:

  • fiverr_api
    • gig_scrape.py: Contains functions to scrape gig-related information.
    • profile_scrape.py: Contains functions to scrape user profile information.
  • fiverr_api.utils
    • scrape_utils.py: Contains utility functions for extracting information from HTML elements.
    • actions.py: Defines the Actions class responsible for handling HTTP requests.

scraper.py gives you a function named get_perseus_initial_props() which returns the initial props of the Fiverr page. This function is used by the modules to extract initial JSON data from the page, and is also used by gig_scrape.py and profile_scrape.py to extract data from the page.

License

GPL

Contributing

New pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Author

Check more of my projects.

fiverr-scraping-api's People

Contributors

bishwas-py 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.