my simple crawler
Project description
Install
pip3 install simple-crawler
Example
from simple_crawler import *
class MyCrawler(Crawler):
name = 'output.txt'
def custom_handler_page(self, page):
print(page.url)
tags = page.soup.select("#nr1")
tag = tags and tags[0]
with open(self.name, 'a') as f:
f.write(tag.text)
print(tag.text)
def filter_url(self, url: URL) -> bool:
return url.url.startswith("https://xxx.com/xxx")
c = MyCrawler("https://xxx.com/xxx")
c.start()
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
Close
Hashes for simple_crawler-0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6507c469adb397d4686ad2d5951170061212f58fbdddf5ef49e4655b1960b484 |
|
MD5 | 7d5d447e9a82dc28d26f496e7a61f440 |
|
BLAKE2b-256 | 40d2f2d67c6958ef1e4c23db45b5fbdb11ca2e8e33463b9b590ef8973cbc06a5 |