Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Repository files navigation

Hexlet tests and linter status:

Actions Status

Demo:

Demo site

Page Analyzer

Page Analyzer is a web application built with Flask that allows users to add URLs and analyze them for various attributes like title, h1, and meta description. It uses BeautifulSoup and requests libraries to fetch and parse the content of the pages.

Features

  • Add URLs to the database
  • Fetch and display page attributes like title, h1, and description
  • Check URLs for updates
  • Display the history of checks for each URL

Requirements

  • Python 3.10+
  • PostgreSQL
  • Flask
  • BeautifulSoup
  • requests
  • dotenv

Installation

  1. Clone the repository:

    git clone https://github.com/SvamiBog/python-project-83.git
    cd python-project-83
  2. Create a virtual environment and activate it:

    python -m venv venv
    source venv/bin/activate  # On Windows use `venv\Scripts\activate`
  3. Install the dependencies:

    pip install -r requirements.txt
  4. Set up the database: Ensure you have PostgreSQL installed and create a database for the project.

    CREATE DATABASE page_analyzer;

    Update the .env file with your database credentials:

    DATABASE_URL=postgresql://<username>:<password>@localhost/page_analyzer
    SECRET_KEY=<your_secret_key>
    
  5. Run the database migrations:

    python -c "from db import create_tables; create_tables()"
  6. Run the application:

    flask run

    The application will be available at http://127.0.0.1:5000/.

Usage

  1. Add a URL:

    • Enter the URL you want to analyze in the input field on the home page and submit.
    • The URL will be added to the database, and you will be redirected to the URL's detail page.
  2. Check a URL:

    • On the URL's detail page, click the "Запустить проверку" button to fetch and display the latest attributes of the page.
    • The results of the check will be stored and displayed in a history table.

Running Tests

To run the tests, use the following command:

pytest

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages