Skip to content

ycchuang99/ptt_image_crawler

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PTT Image Crawler

Installation

To get started, install the required dependencies using the following command:

pip install -r requirement.txt

Usage

You can use the provided Python script to scrape images from a PTT board. Use the following command to see the available options:

python main.py -h

This will display the following usage information:

usage: main.py [-h] [--board BOARD] [--pages PAGES]

optional arguments:
  -h, --help            show this help message and exit
  --board BOARD, -b BOARD   Choose a PTT board, e.g., Food
  --pages PAGES, -p PAGES   Set the maximum number of pages, default is all

Example

To scrape all images from the PTT Food board, use the following command:

python main.py --board Food

Docker Support

You can also run the PTT Image Crawler in a Docker container. First, build the Docker image using the following command:

docker build -t my-python-app .

Then, execute the image with the specified options. For example, to scrape images from the Food board and save them to a local directory, use this command:

docker run -it --rm -v /where/you/want/to/save:/usr/src/app/img --name my-running-app my-python-app --board Food

This will run the crawler in an isolated environment within a Docker container.

About

ptt website image crawler

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published