Skip to main content

Semantic crawler with knowledge graph builder

Project description

web-crawler

A web-crawler project that I developed when trying to learn more about XPath, which lead to crawlers and data analysis. Made with python.

Features

  • Recursive crawling with depth control
  • Automatic URL normalization
  • Link extraction
  • Summary extraction
  • Async-ready architecture

Installation

pip install web-crawler-engine

HOW TO USE

from web_crawler import CrawlerEngine

url = "https://en.wikipedia.org/wiki/Artificial_intelligence"

crawler = CrawlerEngine(
    depth_control=30, #controls how many pages you want to view
    url=url
)

crawler.start_crawl_bfs() #starts crawls
crawler.store_data()  #stores data in a pages.json 
crawler.generate_knowledge_graph() #generates a html of a directed graph of pages and their relations

JSON example

  {
    "title": "Black hole",
    "url": "https://en.wikipedia.org/wiki/Black_hole",
    "summary": "A black hole is an astronomical body so compact that its gravity prevents anything, including light, from escaping. Albert Einstein's theory of general relativity, which describes gravitation as the curvature of spacetime, predicts that any sufficiently compact mass will form a black hole. The boundary of no escape is called the event horizon. In general relativity, crossing a black hole's event horizon seals an object's fate but produces no locally detectable change. General relativity also predicts that every black hole should have a central singularity, where the curvature of spacetime is infinite.",
    "links": [
      "https://en.wikipedia.org/wiki/Astronomical_body",
      "https://en.wikipedia.org/wiki/Albert_Einstein",
      "https://en.wikipedia.org/wiki/General_relativity",
      "https://en.wikipedia.org/wiki/Curved_spacetime",
      "https://en.wikipedia.org/wiki/Mass",
      "https://en.wikipedia.org/wiki/Boundary_(topology)",
      "https://en.wikipedia.org/wiki/Event_horizon",
      "https://en.wikipedia.org/wiki/Gravitational_singularity",
      "https://en.wikipedia.org/wiki/Curvature_of_spacetime",
      "https://en.wikipedia.org/wiki/Gravitational_field"
    ]
  },

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

web_crawler_engine-0.1.2.tar.gz (7.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

web_crawler_engine-0.1.2-py3-none-any.whl (8.8 kB view details)

Uploaded Python 3

File details

Details for the file web_crawler_engine-0.1.2.tar.gz.

File metadata

  • Download URL: web_crawler_engine-0.1.2.tar.gz
  • Upload date:
  • Size: 7.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for web_crawler_engine-0.1.2.tar.gz
Algorithm Hash digest
SHA256 363ee3f2455e8679d38963395ed5816349158a4c980a5fa81b8deb7081d6c389
MD5 9801c27ba63f622eed187580702f48a8
BLAKE2b-256 7c3022bccbcef9af14c02dbb0157cb651e250b016c092851c363ad0484ae45c7

See more details on using hashes here.

File details

Details for the file web_crawler_engine-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for web_crawler_engine-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 bf36ef6610e89d634123661e8bc72f061b9d5d8dbb551308ca1d003a8810189f
MD5 15aa2ee14cbc238e3e2ae6e833140977
BLAKE2b-256 deddcb106aeb3f09e8f44c4232dccad2eb0f7099488ac1d7eff284a360bd3750

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page