# ---
# jupyter:
#   jupytext:
#     text_representation:
#       extension: .py
#       format_name: light
#       format_version: '1.5'
#       jupytext_version: 1.14.4
#   kernelspec:
#     display_name: Python 3
#     language: python
#     name: python3
# ---

# +
from bs4 import BeautifulSoup
import requests

URL = 'https://www.popularonline.com.my/default/malay.html?did=1996'
page = requests.get(URL)

soup = BeautifulSoup(page.content, 'html.parser')
print(soup.prettify())
# -

containers = soup.findAll('div',{'class':'col-sm-3'})

for container in containers:
    print(container.get_text().strip().partition("\n")[2].partition("\n")[2].partition("\n")[2][34:-41].strip())
    print("---------------")

soup.findAll('div',{'class':'col-sm-3'})[2].get_text().strip()

containers[0].get_text().strip().partition("\n")[2].partition("\n")[2].partition("\n")[2][34:-41].strip()



StarcoderdataJupyterScriptsDedupFiltered