Skip to main content

Scrapes online petition data from change.org

Project description

ChangeDotOrgScraper is an Python package that allows you to scrape online petition data from change.org.

pypi package GitHub Source Code

Installation

To install in python, simply do the following:

pip install ChangeDotOrgScraper

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
  • beautifulsoup4
  • tqdm
  • lxml
  • selenium
  • webdriver-manager
  • pandas
  • ast (Python standard library)
  • re (Python standard library)
  • json (Python standard library)
  • time (Python standard library)

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

pip install requests beautifulsoup4 lxml tqdm pandas selenium webdriver-manager

Citation

This package was made as part of a larger study on policy-related opinion mining.

If you wish to cite, you may cite:

Alba, C., Warner, B. C., Saxena, A., Huang, J., & An, R. (2025, July). Towards robust sentiment analysis of temporally-sensitive policy-related online text. In Proceedings of the 63rd Annual Meeting of the Association for Computational Linguistics (Volume 4: Student Research Workshop) (pp. 958-976). doi: 10.18653/v1/2025.acl-srw.70

Questions?

Contact me at alba@wustl.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.1.3.tar.gz (7.6 kB view details)

Uploaded Source

File details

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

File metadata

  • Download URL: changedotorgscraper-0.1.3.tar.gz
  • Upload date:
  • Size: 7.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.8

File hashes

Hashes for changedotorgscraper-0.1.3.tar.gz
Algorithm Hash digest
SHA256 842cfaa8a94230e230cc318567dbc60a2a27d2a2c9711127e3ac4258c576a89a
MD5 3d9a26fa52a1a218a60fcbdb1ab35b7e
BLAKE2b-256 9f5d541d454dc073c211ee2b9166e4c018528e7ae6e57716c42a7327e1dabf78

See more details on using hashes here.

Supported by

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