Coder Social home page Coder Social logo

karuwebscraping's Introduction

KaruWebScraping

Web scraping school websites for notices

This script is written in Python and it uses the BeautifulSoup library to scrape the student notice board from the website "https://karu.ac.ke/student-notice-board/".

The script makes a GET request to the URL using the requests library, and retrieves the HTML content of the website. The content is then passed to BeautifulSoup for parsing.

The content variable is then used to search for the 'div' tag with class "gdlr-core-pbf-column gdlr-core-column-60 gdlr-core-column-first". This is done using the find() method, which returns the first occurrence of the tag.

The script then finds all the 'h3' tags with class "gdlr-core-blog-title gdlr-core-skin-title". These tags contain the titles of the notices on the notice board.

A for loop is used to iterate over the titles and extract the text content of each title. The text content is then stripped of any whitespaces and is stored in the 'notices' variable.

Finally, the script opens a file named "notice.txt" and appends the notices to the file using the "write" method. The file is then closed using the close() method. The notices are also printed to the console for easy viewing.

karuwebscraping's People

Contributors

munyuawilson avatar

Stargazers

 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.