Scrapes petitions and corresponding information from change.org
Project description
Scrapes petitions from change.org.
Quick Start
Here we provide a quick example on how you can use ChangeDotOrgScraper
to scrape petitions 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 related to SNAP as well as corresponding details (eg 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) change_org_scraper: A python package to scrape petitions 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
File details
Details for the file changedotorgscraper-0.0.1.tar.gz
.
File metadata
- Download URL: changedotorgscraper-0.0.1.tar.gz
- Upload date:
- Size: 5.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d09d293ef37c0f9396fbb37cbb5a5afb35dd0b596afb7104261c663c469fb8c5 |
|
MD5 | 78d5cc357d5e5bb64977ce5a3318ccb3 |
|
BLAKE2b-256 | 99bf69a6f839c2996b4208b18d320da1585112d07c63c2ef543a1080a7e6717d |