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@wustl.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.9.tar.gz
.
File metadata
- Download URL: changedotorgscraper-0.0.9.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 | fbc714d9ae3488f7078f9a6bdab1bab3c7e8c0bb1864b698fae0f21448cc46fe |
|
MD5 | 3789b75d06b6207463c3de66c6e03745 |
|
BLAKE2b-256 | ed17884aed163e89e86c5607487a99065a6436f007a905825b0798edca047718 |
File details
Details for the file ChangeDotOrgScraper-0.0.9-py3-none-any.whl
.
File metadata
- Download URL: ChangeDotOrgScraper-0.0.9-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 | 62512c0d04c83976cd765cb47e5fd826d88428f04cad8826dae534d07213113f |
|
MD5 | 2f15fce5717f855204f1984ba21e0ec0 |
|
BLAKE2b-256 | 12efd7030c322a1d3087581a48aba797e9716d64ac59fb2f1073b9b881e2c1a3 |