Add your description here
Project description
DiiDu爬虫-python版本
尽力做到了对操作, 使用的还原.
使用
-
config的配置
-
- 要求
config = {
'base_url': '...', <-- 爬虫入口
'content': { <-- 用于划分主要区域
'spilt_func': 'extract_content',
'spilt_args': [
'<div class="box1">',
'<div id="div_vote_id"></div>'
]
},
'value':{
'标题'<--字段名: {
'spilt_func': 'extract_content', <-- 使用的函数(暂时只有extract_content)
'spilt_args': [
'<p class="bt">', <-- 参数
'</p>'
]
},
...可以自行添加其他字段名
},
'Next':{ <-- 下一页的配置
'css':'a.Next',
'name':'下页' <-- 如果a.Next不唯一, 则可以根据name来筛选
},
'son':{
'css': '.p2_right>ul>li>a' <-- 子标签的css选择器
}
}
-
- 示例
config = {
'base_url': '...',
'content': {
'spilt_func': 'extract_content',
'spilt_args': [
'<div class="box1">',
'<div id="div_vote_id"></div>'
]
},
'value':{
'标题': {
'spilt_func': 'extract_content',
'spilt_args': [
'<p class="bt">',
'</p>'
]
},
'发布时间': {
'spilt_func': 'extract_content',
'spilt_args': [
'<p>发布时间:',
'</p>'
]
},
'正文内容': {
'spilt_func': 'extract_content',
'spilt_args': [
'<div class="v_news_content">',
'</div>'
]
}
},
'Next':{
'css':'a.Next',
'name':'下页'
},
'son':{
'css': '.p2_right>ul>li>a'
}
}
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file zut_spider-0.1.2-py3-none-any.whl.
File metadata
- Download URL: zut_spider-0.1.2-py3-none-any.whl
- Upload date:
- Size: 3.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
13a54d9a495f20973a4bbac183fd080a7b53fab68acd133a0a65e52a0381e3aa
|
|
| MD5 |
4468d21444175f3e23d4a2816e97329b
|
|
| BLAKE2b-256 |
931a04438afaeea6c02cbaf39b6afa3dff985b21b9da0ed3e3138e4a05fca43f
|