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.
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
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
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
File details
Details for the file changedotorgscraper-0.0.7.tar.gz
.
File metadata
- Download URL: changedotorgscraper-0.0.7.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
Algorithm | Hash digest | |
---|---|---|
SHA256 | fd2d359a9a939c6ff3f5ecef3def8ed063e8e9c0d426c0df51d11af8c5e2d70d |
|
MD5 | bbec5df7014b970422c8b046f4cfc510 |
|
BLAKE2b-256 | f746d1a2ec12b4e762d7c211fad28b2ecc0cb6c9edd394546bd6e0aa25fbd6f4 |
File details
Details for the file ChangeDotOrgScraper-0.0.7-py3-none-any.whl
.
File metadata
- Download URL: ChangeDotOrgScraper-0.0.7-py3-none-any.whl
- Upload date:
- Size: 5.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4ae83af05b23c61b306e0829ef923fa927b87d7bf107b4f2c16f5fd4c188ba97 |
|
MD5 | 80da35f66d1147de945ced7bd68eb164 |
|
BLAKE2b-256 | c1c96477d787e035d835e732b3ccf831d6a2b3af1a250d0a4f789b7f289b504f |