Scrapes online petition data from change.org
Project description
Scrapes 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 with details such as the petition(s) 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
Built Distribution
Hashes for changedotorgscraper-0.0.4.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 681d84b3535d52bdc5f3e605b3a090c0e9b219bdbf141764882b321baf2cd08c |
|
MD5 | 81fde4b48d380284d4a96ff2769ed7e7 |
|
BLAKE2b-256 | 6926b16c3c2797da04c79186a6a190ef29521e3cba53d1afd4e18b75e0bd3441 |
Hashes for ChangeDotOrgScraper-0.0.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 582c7300779f3a3ca8d14b9a9fbed48d11d674ef898b12a4b662e235ece385c2 |
|
MD5 | a359ad142415afed5aa41b53ca97a3e1 |
|
BLAKE2b-256 | 8db283b9d96fe91295dc09b24b275400c9b8620584e1092fd385a3d863e32895 |