Skip to main content

Scrapes online petition data from change.org

Project description

Scrapes online petition data from change.org.

pypi package GitHub Source Code

Quick Start

Here we provide a quick example on how you can use ChangeDotOrgScraper to scrape petition data right from change.org.

from ChangeDotOrgScraper import scrape_petitions



# Specify the url of your scrape.org searches

## for instance, we shall scrape petitions from the search "supplemental nutrition assistance program"

url='https://www.change.org/search?q=Supplemental%20Nutrition%20Assistance%20Program&offset=0'



# scrape the petition data from change.org

SNAP_petitions_df=scrape_petitions(url)

print(SNAP_petitions_df)

It returns a dataframe with all the petitions data, which contains details such as the petition(s) title, description, date created, target audience signature count, location created, victory status, etc.

Requirements

Required packages

To use ChangeDotOrgScraper, you are required to have the following packages installed:

  • requests

  • bs4

  • tqdm

  • pandas

  • ast

  • re (Python standard library)

  • json (Python standard library)

If you do not have these packages installed in python, you can do the following:

pip install requests bs4 tqdm pandas ast

Installation

To install in python, simply do the following:

pip install ChangeDotOrgScraper

Citation

This package was made as part of a larger study on food stamps (i.e., SNAP), therefore, we do not have the paper ready just yet.

However, if you wish to cite, you may cite:

C Alba (2024) ChangeDotOrgScraper: A python package to scrape petition data from change.org. PyPi.

Questions?

Contact me at alba@wusl.edu

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

changedotorgscraper-0.0.5.tar.gz (5.5 kB view details)

Uploaded Source

Built Distribution

ChangeDotOrgScraper-0.0.5-py3-none-any.whl (5.9 kB view details)

Uploaded Python 3

File details

Details for the file changedotorgscraper-0.0.5.tar.gz.

File metadata

  • Download URL: changedotorgscraper-0.0.5.tar.gz
  • Upload date:
  • Size: 5.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.4

File hashes

Hashes for changedotorgscraper-0.0.5.tar.gz
Algorithm Hash digest
SHA256 998a2cd817bf4ae83c980f284cc85138b1e8373ca3ace9dfe1d4a52de3ec14b1
MD5 3d421b62b496886b15f4a52801bc5139
BLAKE2b-256 14977fcb9ab2a6103e0aca4811a292f8c4ea7af32df9505eb3d2eee949be41bb

See more details on using hashes here.

File details

Details for the file ChangeDotOrgScraper-0.0.5-py3-none-any.whl.

File metadata

File hashes

Hashes for ChangeDotOrgScraper-0.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 338f1532e745c0c90f4a952a1740908179b91b61dfffc952748ca2955e5a5865
MD5 eb46a9fa9ea41b6f91854a65edb1fd5d
BLAKE2b-256 fc8363dfdedde21cdcf13493f82b2838d3cd8e76cd84bb278a3c9fa9d8e2295f

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page