Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/chenbingwei1201/threads_scraper
A Python package for scraping Threads posts.
https://github.com/chenbingwei1201/threads_scraper
chromedriver crawler csv-format pypi pypi-package python python3 scraper scraping-websites
Last synced: 30 days ago
JSON representation
A Python package for scraping Threads posts.
- Host: GitHub
- URL: https://github.com/chenbingwei1201/threads_scraper
- Owner: ChenBingWei1201
- License: mit
- Created: 2024-12-03T08:34:17.000Z (about 1 month ago)
- Default Branch: main
- Last Pushed: 2024-12-03T16:23:41.000Z (about 1 month ago)
- Last Synced: 2024-12-03T17:33:34.504Z (about 1 month ago)
- Topics: chromedriver, crawler, csv-format, pypi, pypi-package, python, python3, scraper, scraping-websites
- Language: Python
- Homepage: https://pypi.org/project/threads-scraper/
- Size: 5.86 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# threads_scraper
A Python package for scraping Threads posts.
## Installation
Install the package using pip:
```bash
pip install threads-scraper
```## Usage
```python
from threads_scraper.scraper import ThreadsScraper# Initialize the scraper
scraper = ThreadsScraper(
username="your_username",
password="your_password",
driver_path="/path/to/chromedriver",
)scroll_times = 10
csv_index = True# Start the scraper
scraper.get_driver()if scraper.login_to_threads():
data = scraper.scrape(["keyword1", "keyword2"], scroll_times) # default scroll_times = 5
scraper.save_to_csv(data, "data/threads_posts.csv", csv_index) # default csv_index = Falsescraper.close()
```