IcePick
IcePick is a All in one Package library for easy Scraping
Concept
Lightweight Scraping Library
All in one Package library for easy Scraping
Requirements
Python 3.4 or later(not support 2.x)
MongoDB
Dependencies Libraries
aiohttp
beautifulsoup4
pymongo >= 3.0
nose
Usage
Scraping Flow,
Your Scraping Order(Order) -> Do Scraping(Picker) -> HTML Parse(Parser) -> Save in Database(Recorder)
Example
get a my repository filenames
import icePick
db = icePick.get_database('icePick_example', 'localhost')
class GithubRepoParser(icePick.Parser):
def serialize(self):
result = {
"files": [],
}
for v in self.bs.find_all(class_="js-directory-link"):
result['files'] += [v.text]
return result
class GithubRepoRecorder(icePick.Recorder):
struct = icePick.Structure(files=list())
class Meta:
database = db
class GithubRepoOrder(icePick.Order):
recorder = GithubRepoRecorder
parser = GithubRepoParser
def main():
document = {
'url': 'https://github.com/teitei-tk/ice-pick/tree/master',
'ua': 'Mozilla/5.0 (Windows NT 6.3; Trident/7.0; rv:11.0) like Gecko',
}
print('---download start---')
order = GithubRepoOrder(document.get('url'), document.get('ua'))
picker = icePick.Picker([order])
picker.run()
print("---finish---")
if __name__ == "__main__":
main()
>>> import icePick
>>> db = icePick.get_database('icePick_example', 'localhost')
>>> class GithubRepoRecorder(icePick.Recorder):
... struct = icePick.Structure(files=list())
... class Meta:
... database = db
...
>>> records = GithubRepoRecorder.find()
>>> records[0].files
['example', 'icePick', 'tests', 'LICENSE', 'README.md', 'circle.yml', 'requirements.txt']
>>>
TODO
Crawling
Document
LICENSE
MIT
Metadata
Release files for icePick 0.0.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| icePick-0.0.5.tar.gz | 6.5 kB | Without provenance | Details for icePick-0.0.5.tar.gz |
Release files / icePick-0.0.5.tar.gz
| Download URL | icePick-0.0.5.tar.gz |
|---|---|
| Size | 6.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
af0a13832add144af80b231ed0ed7232aa5ca7b2d2f2b317cb2aa0e8ecab154b
|
|
BLAKE2b-256 checksum How to use checksums |
6dd5081c9f31bad2775a4b7cf7c9921ae0491df0c7ed7cf50830e4033feca89e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for icePick 0.0.5
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.