CryptoScraper is a Python script for fetching cryptocurrency data from BitDegree's top crypto gainers page. It can retrieve data for all sections or a specific section based on the title.
- Fetch all cryptocurrency data from BitDegree.
- Fetch data for a specific section by title.
- Support for setting a proxy.
-
Clone the repository:
git clone https://github.com/specialteam/CryptoScraper.git cd cryptoscraper -
Install the required packages:
pip install requests beautifulsoup4
You can fetch all cryptocurrency data with the following script:
from crypto_scraper import CryptoScraper
# Create an instance of the scraper
scraper = CryptoScraper()
# Fetch all data
all_data = scraper.fetch_data()
for title, data in all_data.items():
print(f"Section: {title}")
for item in data:
print(item)
print("\n" + "-"*50 + "\n")To fetch data for a specific section by title:
from crypto_scraper import CryptoScraper
# Create an instance of the scraper
scraper = CryptoScraper()
# Fetch a specific section
section_title = "Biggest Volume Increase"
section_data = scraper.fetch_section(section_title)
print(f"Section: {section_title}")
for item in section_data:
print(item)
print("\n" + "-"*50 + "\n")If you need to use a proxy, you can set it before fetching data:
from crypto_scraper import CryptoScraper
# Create an instance of the scraper
scraper = CryptoScraper()
# Set proxy
scraper.set_proxy("http://your_proxy_here")
# Fetch all data
all_data = scraper.fetch_data()
for title, data in all_data.items():
print(f"Section: {title}")
for item in data:
print(item)
print("\n" + "-"*50 + "\n")You can run the provided tests using unittest:
python -m unittest discoverThis project is licensed under the MIT License.
Contributions are welcome! Please open an issue or submit a pull request for any improvements or bug fixes.
For any questions or comments, please reach out to https://t.me/amirspecial