https://github.com/allanbian1017/mbpprice
二手Macbook Pro資訊
https://github.com/allanbian1017/mbpprice
crawler python
Last synced: 5 months ago
JSON representation
二手Macbook Pro資訊
- Host: GitHub
- URL: https://github.com/allanbian1017/mbpprice
- Owner: allanbian1017
- License: mit
- Created: 2019-05-25T09:59:21.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2022-12-08T02:32:20.000Z (over 3 years ago)
- Last Synced: 2024-10-12T09:10:03.911Z (over 1 year ago)
- Topics: crawler, python
- Language: Python
- Homepage:
- Size: 18.6 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# MBPPrice
[](https://pypi.org/project/mbpprice/)
[](https://pypi.org/project/mbpprice/)
[](https://pypi.org/project/mbpprice/)
MBPPrice用來抓取二手Macbook Pro的價格和相關資訊
## Setup
```bash
pip install mbpprice
```
## Utility
```bash
# 搜尋 PTT 二手 Macbook Pro 資訊
python3 -m mbpprice search ptt
```
## Example
```python
from mbpprice.search import MBPSearch
results = MBPSearch('ptt').list(limit=10)
for (i, item) in enumerate(results):
print('{:03d}: {}'.format(i, item['url']))
print('價格: {}'.format(item['price']))
print(
'年份: {} / 螢幕尺寸: {} / 電池循環: {}'.format(item['year'], item['screen'], item['bat_count']))
print(
'CPU: {} / RAM: {} / 硬碟容量: {}'.format(item['cpu'], item['ram'], item['hdd']))
print()
```