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.
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
-
pandas
-
ast
(Python standard library) -
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 beautifulsoup4 tqdm pandas
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for changedotorgscraper-0.0.8.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 397ab7cdbb7ed598ef8b3fca4851e927a33aca4e5c5ff62878412d6a8840d46f |
|
MD5 | 683584f659d3a1934718e3600a7c96ad |
|
BLAKE2b-256 | 110957aa8f7d6860ec72263283ea37d0dca4e2890dcfc8b79f97a0dd277a0471 |
Hashes for ChangeDotOrgScraper-0.0.8-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 73cbbcf517c3a21fe6a2ce83467631786e1f18c7d1a5446a3bd6854f26a0bf0e |
|
MD5 | 7447655f193b848f5e505d1e09773741 |
|
BLAKE2b-256 | 7d631d268f75cdd08e2584d2d20367f31fae84d0f3ecbcbd83f4ef245bb53a0c |