{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "#import library\n",
    "import urllib\n",
    "import requests\n",
    "import bs4\n",
    "import pandas as pd"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "# request a link\n",
    "def request_url(link):\n",
    "    response = requests.get(link)\n",
    "    html = response.text\n",
    "    return html"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [],
   "source": [
    "# Function to parse html\n",
    "def parse_html(to_parse):\n",
    "    soup = bs4.BeautifulSoup(to_parse, 'html.parser')\n",
    "    return soup"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [],
   "source": [
    "#take sub menu news form liputan6.com\n",
    "def all_section(main_url):\n",
    "    section_list = []\n",
    "    for i in main_url:\n",
    "        soup = parse_html(request_url(i))\n",
    "        for a in soup.find_all('a', href=True):\n",
    "            if a.text:\n",
    "                section_list.append(a['href'])\n",
    "    return section_list"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [],
   "source": [
    "#get only link about corona or covid\n",
    "def find_corona(main_url):\n",
    "    url_list = []\n",
    "    not_news=[]\n",
    "    for i in main_url:\n",
    "        if i.find('corona')!=-1 or i.find('covid')!=-1 or i.find('pandemi')!=-1 or i.find('psbb')!=-1 or i.find('social-distancing')!=-1:\n",
    "            url_list.append(i)\n",
    "    url_list = list(dict.fromkeys(url_list))\n",
    "    for i in url_list:\n",
    "        if (i.find('read') == -1):\n",
    "            not_news.append(i)       \n",
    "    for j in not_news:\n",
    "        url_list.remove(j)\n",
    "    return url_list"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [],
   "source": [
    "def title(main_url):\n",
    "    titles = []\n",
    "    for i in main_url:\n",
    "        soup=parse_html(request_url(i))\n",
    "        get_title = soup.find(\"h1\", class_=\"read-page--header--title entry-title\")\n",
    "        get_title_photosnews = soup.find(\"h2\", class_=\"read-page--photo-tag--header__title\")\n",
    "        if(get_title):\n",
    "            titles.append(get_title.text)\n",
    "        elif(get_title_photosnews):\n",
    "            titles.append(get_title_photosnews.text)\n",
    "        else:\n",
    "            titles.append('None')\n",
    "    return titles "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [],
   "source": [
    "def writer(main_url):\n",
    "    author = []\n",
    "    for i in main_url:\n",
    "        soup=parse_html(request_url(i))\n",
    "        get_author = soup.find(\"span\", class_=\"read-page--header--author__name fn\")\n",
    "        get_editor = soup.find(\"div\", class_=\"read-page--photo-tag--header__credits-user\")\n",
    "        if(get_author):\n",
    "            author.append(get_author.text)\n",
    "        elif(get_editor):\n",
    "            author.append(get_editor.text)\n",
    "        else:\n",
    "            author.append('None')\n",
    "    return author"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [],
   "source": [
    "def date(main_url):\n",
    "    datetime = []\n",
    "    for i in main_url:\n",
    "        soup=parse_html(request_url(i))\n",
    "        get_datetime = soup.find(\"time\", class_=\"read-page--header--author__datetime updated\")\n",
    "        get_datetime_photosnews = soup.find(\"time\", class_=\"read-page--photo-tag--header__datetime updated\")\n",
    "        if(get_datetime):\n",
    "            datetime.append(get_datetime.text)\n",
    "        elif(get_datetime_photosnews):\n",
    "            datetime.append(get_datetime_photosnews.text)\n",
    "        else:\n",
    "            datetime.append('None')\n",
    "    return datetime"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [],
   "source": [
    "def collect_text(main_url, titles = [], author = [], datetime = []):\n",
    "    paragraf = []\n",
    "    data = []\n",
    "    join =[]\n",
    "    isiteks = []\n",
    "\n",
    "    for i,j in enumerate(main_url):\n",
    "        a = parse_html(request_url(j))\n",
    "        pragraf_text = a.find_all(\"div\", class_=\"article-content-body__item-page\")\n",
    "        pragraf_photos = a.find_all(\"div\", class_=\"read-page--photo-tag--header__content\")\n",
    "        if(pragraf_text):\n",
    "            for k in pragraf_text:\n",
    "                newparagraf = k.find_all('p')\n",
    "                for x in newparagraf:\n",
    "                    paragraf.append(x.text)\n",
    "        else:\n",
    "            for k in pragraf_photos:\n",
    "                paragraf.append(k.text)\n",
    "        data.append(paragraf)\n",
    "        paragraf = []\n",
    "    for i in data:\n",
    "        join.append(' '.join(i))\n",
    "         \n",
    "    for i, j in enumerate(main_url):\n",
    "        isiteks.append({'news': 'Liputan6.com', 'link' : j, 'title': titles[i], 'author' : author[i], 'date_time': datetime[i], 'paragraf' : join[i]})\n",
    "    return isiteks"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [],
   "source": [
    "def save_file(file, file_name = ''):\n",
    "    new_file = pd.DataFrame(file, columns=['news','link','title', 'author', 'date_time', 'paragraf'])\n",
    "    new_file.to_csv(file_name + '.csv', index=True, encoding='utf-8', sep = ',')\n",
    "    \n",
    "    return new_file"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [],
   "source": [
    "def get_news(main_url, file_name = ''):\n",
    "    section = all_section(main_url)\n",
    "    corona_news = find_corona(section)\n",
    "    titles = title(corona_news)\n",
    "    author = writer(corona_news)\n",
    "    datetime = date(corona_news)\n",
    "    text = collect_text(corona_news, titles, author, datetime)\n",
    "    file = save_file(text, file_name)\n",
    "    \n",
    "    return file "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [],
   "source": [
    "url=[\"https://www.liputan6.com/\"]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>news</th>\n",
       "      <th>link</th>\n",
       "      <th>title</th>\n",
       "      <th>author</th>\n",
       "      <th>date_time</th>\n",
       "      <th>paragraf</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>Liputan6.com</td>\n",
       "      <td>https://www.liputan6.com/otomotif/read/4245824...</td>\n",
       "      <td>Lewat Tembang 'Ojo Mudik', Mendiang Didi Kempo...</td>\n",
       "      <td>Liputan6.com</td>\n",
       "      <td>05 Mei 2020, 14:01 WIB</td>\n",
       "      <td>Liputan6.com, Jakarta - Didi Kempot merupakan ...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>Liputan6.com</td>\n",
       "      <td>https://www.liputan6.com/news/read/4216608/lek...</td>\n",
       "      <td>Lekas Pulih Indonesia, Ayo Bantu Mereka yang T...</td>\n",
       "      <td>Liputan6.com</td>\n",
       "      <td>01 Apr 2020, 13:03 WIB</td>\n",
       "      <td>Liputan6.com, Jakarta - Liputan6.com bersama B...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>Liputan6.com</td>\n",
       "      <td>https://www.liputan6.com/lifestyle/read/424571...</td>\n",
       "      <td>Krisis Corona Covid-19, China Fashion Week 202...</td>\n",
       "      <td>Putu Elmira</td>\n",
       "      <td>05 Mei 2020, 14:01 WIB</td>\n",
       "      <td>Liputan6.com, Jakarta - Ada yang berbeda denga...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>Liputan6.com</td>\n",
       "      <td>https://www.liputan6.com/regional/read/4245208...</td>\n",
       "      <td>Kehabisan Reagen, Gorontalo Menumpang Periksa ...</td>\n",
       "      <td>Yoseph Ikanubun</td>\n",
       "      <td>05 Mei 2020, 14:00 WIB</td>\n",
       "      <td>Liputan6.com, Manado - Laboratorium Polymerase...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>Liputan6.com</td>\n",
       "      <td>https://www.liputan6.com/global/read/4245828/p...</td>\n",
       "      <td>Pandemi Corona COVID-19 Mulai Mereda, Korsel A...</td>\n",
       "      <td>Tommy Kurnia</td>\n",
       "      <td>05 Mei 2020, 14:00 WIB</td>\n",
       "      <td>Liputan6.com, Seoul - Pemerintah Korea Selatan...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>Liputan6.com</td>\n",
       "      <td>https://www.liputan6.com/citizen6/read/4245695...</td>\n",
       "      <td>Diklaim Bisa Cegah Corona, Wanita Ini Rutin Mi...</td>\n",
       "      <td>Camelia</td>\n",
       "      <td>05 Mei 2020, 14:00 WIB</td>\n",
       "      <td>Liputan6.com, Jakarta - Pandemi Corona Covid-1...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>Liputan6.com</td>\n",
       "      <td>https://www.liputan6.com/news/read/4245103/fot...</td>\n",
       "      <td>FOTO: Patut Dicontoh, Warga di Perumahan Ini D...</td>\n",
       "      <td>Johan Fatzry</td>\n",
       "      <td>04 Mei 2020, 18:00 WIB</td>\n",
       "      <td>Bahan pangan gratis tersebut diperuntukkan bag...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>Liputan6.com</td>\n",
       "      <td>https://www.liputan6.com/news/read/4245178/vid...</td>\n",
       "      <td>VIDEO: Kabar Baik, Laju Kasus Positif Covid-19...</td>\n",
       "      <td>Chandra Bayu Witantra</td>\n",
       "      <td>04 Mei 2020, 20:00 WIB</td>\n",
       "      <td>Liputan6.com, Jakarta Ketua Gugus Tugas Percep...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>Liputan6.com</td>\n",
       "      <td>https://www.liputan6.com/showbiz/read/4245155/...</td>\n",
       "      <td>Ari Lasso Beri Semangat pada Masyarakat Lalui ...</td>\n",
       "      <td>Meiristica Nurul</td>\n",
       "      <td>05 Mei 2020, 13:40 WIB</td>\n",
       "      <td>Liputan6.com, Jakarta - Ari Lasso tak bisa tin...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>Liputan6.com</td>\n",
       "      <td>https://hot.liputan6.com/read/4245848/7-potret...</td>\n",
       "      <td>7 Potret Belanja Sayur Online saat Social Dist...</td>\n",
       "      <td>Novita Ayuningtyas</td>\n",
       "      <td>05 Mei 2020, 13:35 WIB</td>\n",
       "      <td>Liputan6.com, Jakarta Selama pandemi corona CO...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>Liputan6.com</td>\n",
       "      <td>https://www.liputan6.com/news/read/4245749/fot...</td>\n",
       "      <td>FOTO: Perawatan Pasien Gangguan Mental di Masa...</td>\n",
       "      <td>Arny Christika Putri</td>\n",
       "      <td>05 Mei 2020, 13:30 WIB</td>\n",
       "      <td>Pihak panti melakukan pencegahan penyebaran vi...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>Liputan6.com</td>\n",
       "      <td>https://www.liputan6.com/news/read/4245868/ceg...</td>\n",
       "      <td>Cegah PHK saat Corona, Zulhas Dorong Subsidi G...</td>\n",
       "      <td>Nanda Perdana Putra</td>\n",
       "      <td>05 Mei 2020, 13:27 WIB</td>\n",
       "      <td>Liputan6.com, Jakarta - Ketua Umum PAN Zulkifl...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>Liputan6.com</td>\n",
       "      <td>https://www.liputan6.com/ramadan/read/4245209/...</td>\n",
       "      <td>Ramadan di Tengah Pandemi, Wamenag Zainut Ajak...</td>\n",
       "      <td>Liputan6.com</td>\n",
       "      <td>05 Mei 2020, 13:20 WIB</td>\n",
       "      <td>Liputan6.com, Jakarta - Wakil Menteri Agama (W...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>Liputan6.com</td>\n",
       "      <td>https://www.liputan6.com/news/read/4245841/upd...</td>\n",
       "      <td>Update Corona DKI Jakarta 5 Mei 2020: 4.641 Po...</td>\n",
       "      <td>Ika Defianti</td>\n",
       "      <td>05 Mei 2020, 13:18 WIB</td>\n",
       "      <td>Liputan6.com, Jakarta - Jumlah kasus positif v...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>Liputan6.com</td>\n",
       "      <td>https://www.liputan6.com/bisnis/read/4245822/r...</td>\n",
       "      <td>Rumah Sakit BUMN Telah Rawat 2.000 Pasien Viru...</td>\n",
       "      <td>Tira Santia</td>\n",
       "      <td>05 Mei 2020, 13:15 WIB</td>\n",
       "      <td>Liputan6.com, Jakarta - Kementerian Badan Usah...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15</th>\n",
       "      <td>Liputan6.com</td>\n",
       "      <td>https://www.liputan6.com/news/read/4245842/pem...</td>\n",
       "      <td>Pemkot Tangerang Jadikan 2 Puskesmas Tempat Is...</td>\n",
       "      <td>Pramita Tristiawati</td>\n",
       "      <td>05 Mei 2020, 13:12 WIB</td>\n",
       "      <td>Liputan6.com, Jakarta - Dua Puskesmas di Kota ...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>16</th>\n",
       "      <td>Liputan6.com</td>\n",
       "      <td>https://www.liputan6.com/news/read/4245829/pan...</td>\n",
       "      <td>Pandemi Corona, Tunjangan PNS DKI Dipotong hin...</td>\n",
       "      <td>Ika Defianti</td>\n",
       "      <td>05 Mei 2020, 13:11 WIB</td>\n",
       "      <td>Liputan6.com, Jakarta - Kepala Badan Kepegawai...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>17</th>\n",
       "      <td>Liputan6.com</td>\n",
       "      <td>https://www.liputan6.com/news/read/4245825/men...</td>\n",
       "      <td>Mendagri Minta Pemkot Depok Selesaikan Masalah...</td>\n",
       "      <td>Fachrur Rozie</td>\n",
       "      <td>05 Mei 2020, 13:09 WIB</td>\n",
       "      <td>Liputan6.com, Jakarta - Menteri Dalam Negeri (...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>18</th>\n",
       "      <td>Liputan6.com</td>\n",
       "      <td>https://www.liputan6.com/global/read/4245769/w...</td>\n",
       "      <td>Wabah Corona COVID-19 Reda, 85 juta Warga Chin...</td>\n",
       "      <td>Natasha Khairunisa Amani</td>\n",
       "      <td>05 Mei 2020, 13:02 WIB</td>\n",
       "      <td>Liputan6.com, Beijing - Kementerian Kebudayaan...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>19</th>\n",
       "      <td>Liputan6.com</td>\n",
       "      <td>https://www.liputan6.com/tekno/read/4245801/bs...</td>\n",
       "      <td>BSA Rilis Panduan Atasi Kejahatan Siber di Ten...</td>\n",
       "      <td>Andina Librianty</td>\n",
       "      <td>05 Mei 2020, 13:01 WIB</td>\n",
       "      <td>Liputan6.com, Jakarta - Software Alliance (BSA...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20</th>\n",
       "      <td>Liputan6.com</td>\n",
       "      <td>https://www.liputan6.com/ramadan/read/4245759/...</td>\n",
       "      <td>Kampanye Ramadan, Ibu Negara UEA Minta Rakyat ...</td>\n",
       "      <td>Tommy Kurnia</td>\n",
       "      <td>05 Mei 2020, 13:00 WIB</td>\n",
       "      <td>Liputan6.com, Abu Dhabi - Pemerintah Uni Emira...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>21</th>\n",
       "      <td>Liputan6.com</td>\n",
       "      <td>https://www.liputan6.com/health/read/4245626/a...</td>\n",
       "      <td>Akurasi Tak Setepat PCR, Gugus Tugas Sebut Rap...</td>\n",
       "      <td>Giovani Dio Prasasti</td>\n",
       "      <td>05 Mei 2020, 13:00 WIB</td>\n",
       "      <td>Liputan6.com, Jakarta Wiku Adisasmito, Ketua T...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>22</th>\n",
       "      <td>Liputan6.com</td>\n",
       "      <td>https://www.liputan6.com/bisnis/read/4245792/s...</td>\n",
       "      <td>Sulit Jual Produk hingga PHK Karyawan, Ini Daf...</td>\n",
       "      <td>Tira Santia</td>\n",
       "      <td>05 Mei 2020, 12:50 WIB</td>\n",
       "      <td>Liputan6.com, Jakarta - Direktur Jenderal Indu...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>23</th>\n",
       "      <td>Liputan6.com</td>\n",
       "      <td>https://www.liputan6.com/cek-fakta/read/424524...</td>\n",
       "      <td>VIDEO CEK FAKTA: Kriminalitas Meningkat di Mas...</td>\n",
       "      <td>Ratu Annisaa Suryasumirat</td>\n",
       "      <td>04 Mei 2020, 20:55 WIB</td>\n",
       "      <td>Liputan6.com, Jakarta Angka kejahatan meningka...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24</th>\n",
       "      <td>Liputan6.com</td>\n",
       "      <td>https://www.liputan6.com/cek-fakta/read/424505...</td>\n",
       "      <td>Cek Fakta: Tidak Benar Presiden Jokowi Menaikk...</td>\n",
       "      <td>Hanz Jimenez Salim</td>\n",
       "      <td>04 Mei 2020, 17:33 WIB</td>\n",
       "      <td>Liputan6.com, Jakarta - Kabar tentang Presiden...</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "            news                                               link  \\\n",
       "0   Liputan6.com  https://www.liputan6.com/otomotif/read/4245824...   \n",
       "1   Liputan6.com  https://www.liputan6.com/news/read/4216608/lek...   \n",
       "2   Liputan6.com  https://www.liputan6.com/lifestyle/read/424571...   \n",
       "3   Liputan6.com  https://www.liputan6.com/regional/read/4245208...   \n",
       "4   Liputan6.com  https://www.liputan6.com/global/read/4245828/p...   \n",
       "5   Liputan6.com  https://www.liputan6.com/citizen6/read/4245695...   \n",
       "6   Liputan6.com  https://www.liputan6.com/news/read/4245103/fot...   \n",
       "7   Liputan6.com  https://www.liputan6.com/news/read/4245178/vid...   \n",
       "8   Liputan6.com  https://www.liputan6.com/showbiz/read/4245155/...   \n",
       "9   Liputan6.com  https://hot.liputan6.com/read/4245848/7-potret...   \n",
       "10  Liputan6.com  https://www.liputan6.com/news/read/4245749/fot...   \n",
       "11  Liputan6.com  https://www.liputan6.com/news/read/4245868/ceg...   \n",
       "12  Liputan6.com  https://www.liputan6.com/ramadan/read/4245209/...   \n",
       "13  Liputan6.com  https://www.liputan6.com/news/read/4245841/upd...   \n",
       "14  Liputan6.com  https://www.liputan6.com/bisnis/read/4245822/r...   \n",
       "15  Liputan6.com  https://www.liputan6.com/news/read/4245842/pem...   \n",
       "16  Liputan6.com  https://www.liputan6.com/news/read/4245829/pan...   \n",
       "17  Liputan6.com  https://www.liputan6.com/news/read/4245825/men...   \n",
       "18  Liputan6.com  https://www.liputan6.com/global/read/4245769/w...   \n",
       "19  Liputan6.com  https://www.liputan6.com/tekno/read/4245801/bs...   \n",
       "20  Liputan6.com  https://www.liputan6.com/ramadan/read/4245759/...   \n",
       "21  Liputan6.com  https://www.liputan6.com/health/read/4245626/a...   \n",
       "22  Liputan6.com  https://www.liputan6.com/bisnis/read/4245792/s...   \n",
       "23  Liputan6.com  https://www.liputan6.com/cek-fakta/read/424524...   \n",
       "24  Liputan6.com  https://www.liputan6.com/cek-fakta/read/424505...   \n",
       "\n",
       "                                                title  \\\n",
       "0   Lewat Tembang 'Ojo Mudik', Mendiang Didi Kempo...   \n",
       "1   Lekas Pulih Indonesia, Ayo Bantu Mereka yang T...   \n",
       "2   Krisis Corona Covid-19, China Fashion Week 202...   \n",
       "3   Kehabisan Reagen, Gorontalo Menumpang Periksa ...   \n",
       "4   Pandemi Corona COVID-19 Mulai Mereda, Korsel A...   \n",
       "5   Diklaim Bisa Cegah Corona, Wanita Ini Rutin Mi...   \n",
       "6   FOTO: Patut Dicontoh, Warga di Perumahan Ini D...   \n",
       "7   VIDEO: Kabar Baik, Laju Kasus Positif Covid-19...   \n",
       "8   Ari Lasso Beri Semangat pada Masyarakat Lalui ...   \n",
       "9   7 Potret Belanja Sayur Online saat Social Dist...   \n",
       "10  FOTO: Perawatan Pasien Gangguan Mental di Masa...   \n",
       "11  Cegah PHK saat Corona, Zulhas Dorong Subsidi G...   \n",
       "12  Ramadan di Tengah Pandemi, Wamenag Zainut Ajak...   \n",
       "13  Update Corona DKI Jakarta 5 Mei 2020: 4.641 Po...   \n",
       "14  Rumah Sakit BUMN Telah Rawat 2.000 Pasien Viru...   \n",
       "15  Pemkot Tangerang Jadikan 2 Puskesmas Tempat Is...   \n",
       "16  Pandemi Corona, Tunjangan PNS DKI Dipotong hin...   \n",
       "17  Mendagri Minta Pemkot Depok Selesaikan Masalah...   \n",
       "18  Wabah Corona COVID-19 Reda, 85 juta Warga Chin...   \n",
       "19  BSA Rilis Panduan Atasi Kejahatan Siber di Ten...   \n",
       "20  Kampanye Ramadan, Ibu Negara UEA Minta Rakyat ...   \n",
       "21  Akurasi Tak Setepat PCR, Gugus Tugas Sebut Rap...   \n",
       "22  Sulit Jual Produk hingga PHK Karyawan, Ini Daf...   \n",
       "23  VIDEO CEK FAKTA: Kriminalitas Meningkat di Mas...   \n",
       "24  Cek Fakta: Tidak Benar Presiden Jokowi Menaikk...   \n",
       "\n",
       "                       author               date_time  \\\n",
       "0                Liputan6.com  05 Mei 2020, 14:01 WIB   \n",
       "1                Liputan6.com  01 Apr 2020, 13:03 WIB   \n",
       "2                 Putu Elmira  05 Mei 2020, 14:01 WIB   \n",
       "3             Yoseph Ikanubun  05 Mei 2020, 14:00 WIB   \n",
       "4                Tommy Kurnia  05 Mei 2020, 14:00 WIB   \n",
       "5                     Camelia  05 Mei 2020, 14:00 WIB   \n",
       "6                Johan Fatzry  04 Mei 2020, 18:00 WIB   \n",
       "7       Chandra Bayu Witantra  04 Mei 2020, 20:00 WIB   \n",
       "8            Meiristica Nurul  05 Mei 2020, 13:40 WIB   \n",
       "9          Novita Ayuningtyas  05 Mei 2020, 13:35 WIB   \n",
       "10       Arny Christika Putri  05 Mei 2020, 13:30 WIB   \n",
       "11        Nanda Perdana Putra  05 Mei 2020, 13:27 WIB   \n",
       "12               Liputan6.com  05 Mei 2020, 13:20 WIB   \n",
       "13               Ika Defianti  05 Mei 2020, 13:18 WIB   \n",
       "14                Tira Santia  05 Mei 2020, 13:15 WIB   \n",
       "15        Pramita Tristiawati  05 Mei 2020, 13:12 WIB   \n",
       "16               Ika Defianti  05 Mei 2020, 13:11 WIB   \n",
       "17              Fachrur Rozie  05 Mei 2020, 13:09 WIB   \n",
       "18   Natasha Khairunisa Amani  05 Mei 2020, 13:02 WIB   \n",
       "19           Andina Librianty  05 Mei 2020, 13:01 WIB   \n",
       "20               Tommy Kurnia  05 Mei 2020, 13:00 WIB   \n",
       "21       Giovani Dio Prasasti  05 Mei 2020, 13:00 WIB   \n",
       "22                Tira Santia  05 Mei 2020, 12:50 WIB   \n",
       "23  Ratu Annisaa Suryasumirat  04 Mei 2020, 20:55 WIB   \n",
       "24         Hanz Jimenez Salim  04 Mei 2020, 17:33 WIB   \n",
       "\n",
       "                                             paragraf  \n",
       "0   Liputan6.com, Jakarta - Didi Kempot merupakan ...  \n",
       "1   Liputan6.com, Jakarta - Liputan6.com bersama B...  \n",
       "2   Liputan6.com, Jakarta - Ada yang berbeda denga...  \n",
       "3   Liputan6.com, Manado - Laboratorium Polymerase...  \n",
       "4   Liputan6.com, Seoul - Pemerintah Korea Selatan...  \n",
       "5   Liputan6.com, Jakarta - Pandemi Corona Covid-1...  \n",
       "6   Bahan pangan gratis tersebut diperuntukkan bag...  \n",
       "7   Liputan6.com, Jakarta Ketua Gugus Tugas Percep...  \n",
       "8   Liputan6.com, Jakarta - Ari Lasso tak bisa tin...  \n",
       "9   Liputan6.com, Jakarta Selama pandemi corona CO...  \n",
       "10  Pihak panti melakukan pencegahan penyebaran vi...  \n",
       "11  Liputan6.com, Jakarta - Ketua Umum PAN Zulkifl...  \n",
       "12  Liputan6.com, Jakarta - Wakil Menteri Agama (W...  \n",
       "13  Liputan6.com, Jakarta - Jumlah kasus positif v...  \n",
       "14  Liputan6.com, Jakarta - Kementerian Badan Usah...  \n",
       "15  Liputan6.com, Jakarta - Dua Puskesmas di Kota ...  \n",
       "16  Liputan6.com, Jakarta - Kepala Badan Kepegawai...  \n",
       "17  Liputan6.com, Jakarta - Menteri Dalam Negeri (...  \n",
       "18  Liputan6.com, Beijing - Kementerian Kebudayaan...  \n",
       "19  Liputan6.com, Jakarta - Software Alliance (BSA...  \n",
       "20  Liputan6.com, Abu Dhabi - Pemerintah Uni Emira...  \n",
       "21  Liputan6.com, Jakarta Wiku Adisasmito, Ketua T...  \n",
       "22  Liputan6.com, Jakarta - Direktur Jenderal Indu...  \n",
       "23  Liputan6.com, Jakarta Angka kejahatan meningka...  \n",
       "24  Liputan6.com, Jakarta - Kabar tentang Presiden...  "
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "liputan6_news=get_news(url, file_name = 'liputan6_satu')\n",
    "liputan6_news"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.3"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}