https://github.com/mic1on/discount
一个自动寻找并通知的全网优惠商品程序
https://github.com/mic1on/discount
Last synced: 10 months ago
JSON representation
一个自动寻找并通知的全网优惠商品程序
- Host: GitHub
- URL: https://github.com/mic1on/discount
- Owner: mic1on
- Created: 2022-02-02T17:08:01.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2022-02-03T10:33:00.000Z (almost 4 years ago)
- Last Synced: 2025-01-14T11:14:18.740Z (12 months ago)
- Language: Python
- Size: 4.88 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
本报程序目的是自动找出全网优惠商品,及时推送给自己
#### 新增消息通知接收方
:grin:[简易消息通知](https://github.com/mic1on/simple-notify)
#### 扩充渠道源
当内置渠道无法满足优惠线报需求,可自定义增加渠道,方法如下:
在spiders/spiders.py的Spiders类中:
```python
@staticmethod
def my_custom(word):
url = f'your_custom_url'
parser = Request().get(url).encode.parser
a_lst = parser.xpath("a标签定位")
for a in a_lst:
yield dict(title=a.xpath('./@title').get(),
href=a.xpath('./@href').get())
```
在settings.py中启用它:
```python
SPIDERS = [
...
"my_custom"
]
```
> 注意:必须是静态方法
#### 新增搜索商品关键词
在settings.py中新增关键词:
```python
SEARCH_WORDS = [
...
"自定义搜索内容"
]
```