Skip to content

Instantly share code, notes, and snippets.

@swdevbali
Created November 1, 2021 09:48
Show Gist options
  • Save swdevbali/4dc3187c2dcae100fa58d39c0113c4f0 to your computer and use it in GitHub Desktop.
Save swdevbali/4dc3187c2dcae100fa58d39c0113c4f0 to your computer and use it in GitHub Desktop.
"""
This project will get the latest information about earthquake from bmkg.go.id
"""
import requests
from bs4 import BeautifulSoup
author = 'Eko SW'
date = '1 November 2022'
url = 'https://www.bmkg.go.id/'
result = requests.get(url)
result = BeautifulSoup(result.text, 'html.parser')
divTag = result.find("span", {"class": "waktu"})
latest_earthquake = divTag.string
print(latest_earthquake)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment