Git Product home page Git Product logo

pyseo-scraper's Introduction

SEO Scraping

This is a Python script that scrapes a website for metadata and generates an XML file with the collected data. The script uses the requests and beautifulsoup4 libraries to retrieve and parse the HTML of the website, and the xml.etree.ElementTree and xml.dom.minidom libraries to create the XML file.

SEO Scraping

Prerequisites

  • Python 3.x
  • requests library
  • beautifulsoup4 library

Installation

Install this tool with pip

pip install requests
pip install beautifulsoup4

Usage

Clone the project

  git clone https://github.com/therealroomio/PySEO-Scraper

Go to the project directory

  cd PySEO-Scraper

Install dependencies

  pip install requests
  pip install beautifulsoup4

To use the script, open scrape.py and update the following line of code:

url = "https://google.com/"

Replace https://google.com/ with the URL of the website you want to scrape then run it in Python.

python3 scrape.py

The script will output an XML file in the same directory as the script, with the name <title>.xml. The file will contain the following metadata:

  • Title
  • Description
  • Keywords
  • Canonical URL
  • Robots
  • Open Graph title
  • Open Graph description
  • Open Graph image
  • H1 tags
  • H2 tags
  • Image alt text

If any of the metadata is missing on the website, the script will insert "missing" as the value for that metadata.

Authors

@therealroomio using ChatGPT

pyseo-scraper's People

Contributors

therealroomio avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.