Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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.

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 = False

scraper.close()
```