Package: webster-crawler
WebsterWebster is an experimental python web scraping framework for my own learning.Webster can be used to scrape or download webpages by giving a list of urls to visit and
optionally a list of urls to stay within.Webster could be used as a broad crawler also, but it is not optimized for that as of now.VersionWebster has been tested using Python 3.10+Project documentationQuick start guideArchitectural modelFunctional specificationTest documentationInstallationInstall Webster using one off the following methodsFrom requirements.txtpipinstall-rrequirements.txtDependenciesWebster is using multiple external Python packages some of which are:lxmlused for processing html documents.w3libused for URL handling and prosessing.pycURLused for networking and making requests to a http server.pymongotools for working with mongoDB using pythonUsepipreqsto make new requirements.txt
if new dependencies are added in PR force over requirements.txt
and make sure to include the new one in PR.pipreqs--forceUpdate dependencies if necessarypipinstall-U-rrequirements.txtTestingWebster usesunittestfor testing.To run all the tests use the following command:python-munittestdiscover-vExample: We want to test Parser module
To run single module test use the following command:python-munittesttest.test_parser-vCoverageTo run test coverage use thecoveragemodulepython-mcoveragerun-munittestTo show coverage report in terminalpython-mcoveragereportOutput should look something like this.Name                              Stmts   Miss  Cover-----------------------------------------------------test/__init__.py                      0      0   100%test/test_data/__init__.py           10      0   100%test/test_downloader.py              43      1    98%test/test_parser.py                  54      1    98%test/test_request.py                 49      2    96%test/test_robotstxt.py               23      1    96%test/test_url_tools.py               22      1    95%test/test_validators.py              53      1    98%webster/__init__.py                   0      0   100%webster/conf/__init__.py              0      0   100%webster/conf/settings.py              9      0   100%webster/core/__init__.py              0      0   100%webster/core/downloader.py           36      8    78%webster/core/parser.py               40      1    98%webster/net/__init__.py               0      0   100%webster/net/request/__init__.py      47      2    96%webster/pipelines/__init__.py         0      0   100%webster/robotstxt.py                 15      2    87%webster/utils/__init__.py             0      0   100%webster/utils/url_tools.py           15      0   100%webster/utils/validators.py          16      7    56%-----------------------------------------------------TOTAL                               432     27    94%For a nicer report and more detailed use the html reportpython-mcoveragehtml

openhtmlcov/index.htmlContributingPull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.Please make sure to update tests as appropriate.LicenseBSD 3-Clause LicenseCopyright (c) 2022, Henri Remonen.
All rights reserved.Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.