{"nbformat":4,"nbformat_minor":0,"metadata":{"colab":{"name":"scrape_shoppe_review_with_rating_v11_fix.ipynb","provenance":[],"collapsed_sections":[]},"kernelspec":{"name":"python3","display_name":"Python 3"},"language_info":{"name":"python"}},"cells":[{"cell_type":"code","metadata":{"id":"44CCFAc9123S","colab":{"base_uri":"https://localhost:8080/"},"executionInfo":{"status":"ok","timestamp":1621426739899,"user_tz":-420,"elapsed":37467,"user":{"displayName":"oktaria mong","photoUrl":"https://lh3.googleusercontent.com/a-/AOh14GjlHl7oQkC48hGy4Tpo0W4L3hlUryoPYs46z6v3=s64","userId":"14816202966115707672"}},"outputId":"da0af888-fa0f-476a-b25c-1d3947f06fc0"},"source":["!pip install selenium\n","!apt-get update # to update ubuntu to correctly run apt install\n","!apt install chromium-chromedriver\n","!cp /usr/lib/chromium-browser/chromedriver /usr/bin\n","import sys\n","sys.path.insert(0,'/usr/lib/chromium-browser/chromedriver')\n"],"execution_count":null,"outputs":[{"output_type":"stream","text":["Collecting selenium\n","\u001b[?25l Downloading https://files.pythonhosted.org/packages/80/d6/4294f0b4bce4de0abf13e17190289f9d0613b0a44e5dd6a7f5ca98459853/selenium-3.141.0-py2.py3-none-any.whl (904kB)\n","\u001b[K |████████████████████████████████| 911kB 6.6MB/s \n","\u001b[?25hRequirement already satisfied: urllib3 in /usr/local/lib/python3.7/dist-packages (from selenium) (1.24.3)\n","Installing collected packages: selenium\n","Successfully installed selenium-3.141.0\n","Get:1 http://security.ubuntu.com/ubuntu bionic-security InRelease [88.7 kB]\n","Get:2 https://cloud.r-project.org/bin/linux/ubuntu bionic-cran40/ InRelease [3,626 B]\n","Ign:3 https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64 InRelease\n","Get:4 http://ppa.launchpad.net/c2d4u.team/c2d4u4.0+/ubuntu bionic InRelease [15.9 kB]\n","Hit:5 http://archive.ubuntu.com/ubuntu bionic InRelease\n","Ign:6 https://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu1804/x86_64 InRelease\n","Get:7 https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64 Release [697 B]\n","Hit:8 https://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu1804/x86_64 Release\n","Get:9 https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64 Release.gpg [836 B]\n","Get:10 http://archive.ubuntu.com/ubuntu bionic-updates InRelease [88.7 kB]\n","Get:11 http://security.ubuntu.com/ubuntu bionic-security/main amd64 Packages [2,150 kB]\n","Hit:12 http://ppa.launchpad.net/cran/libgit2/ubuntu bionic InRelease\n","Get:13 http://archive.ubuntu.com/ubuntu bionic-backports InRelease [74.6 kB]\n","Get:14 http://security.ubuntu.com/ubuntu bionic-security/restricted amd64 Packages [423 kB]\n","Hit:15 http://ppa.launchpad.net/deadsnakes/ppa/ubuntu bionic InRelease\n","Get:16 http://security.ubuntu.com/ubuntu bionic-security/universe amd64 Packages [1,412 kB]\n","Get:17 https://cloud.r-project.org/bin/linux/ubuntu bionic-cran40/ Packages [60.5 kB]\n","Get:18 http://ppa.launchpad.net/graphics-drivers/ppa/ubuntu bionic InRelease [21.3 kB]\n","Ign:20 https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64 Packages\n","Get:20 https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64 Packages [772 kB]\n","Get:21 http://ppa.launchpad.net/c2d4u.team/c2d4u4.0+/ubuntu bionic/main Sources [1,767 kB]\n","Get:22 http://archive.ubuntu.com/ubuntu bionic-updates/universe amd64 Packages [2,183 kB]\n","Get:23 http://ppa.launchpad.net/c2d4u.team/c2d4u4.0+/ubuntu bionic/main amd64 Packages [904 kB]\n","Get:24 http://archive.ubuntu.com/ubuntu bionic-updates/restricted amd64 Packages [452 kB]\n","Get:25 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 Packages [2,582 kB]\n","Get:26 http://ppa.launchpad.net/graphics-drivers/ppa/ubuntu bionic/main amd64 Packages [41.5 kB]\n","Fetched 13.0 MB in 4s (3,654 kB/s)\n","Reading package lists... Done\n","Reading package lists... Done\n","Building dependency tree \n","Reading state information... Done\n","The following package was automatically installed and is no longer required:\n"," libnvidia-common-460\n","Use 'apt autoremove' to remove it.\n","The following additional packages will be installed:\n"," chromium-browser chromium-browser-l10n chromium-codecs-ffmpeg-extra\n","Suggested packages:\n"," webaccounts-chromium-extension unity-chromium-extension\n","The following NEW packages will be installed:\n"," chromium-browser chromium-browser-l10n chromium-chromedriver\n"," chromium-codecs-ffmpeg-extra\n","0 upgraded, 4 newly installed, 0 to remove and 72 not upgraded.\n","Need to get 86.6 MB of archives.\n","After this operation, 300 MB of additional disk space will be used.\n","Get:1 http://archive.ubuntu.com/ubuntu bionic-updates/universe amd64 chromium-codecs-ffmpeg-extra amd64 90.0.4430.93-0ubuntu0.18.04.1 [1,128 kB]\n","Get:2 http://archive.ubuntu.com/ubuntu bionic-updates/universe amd64 chromium-browser amd64 90.0.4430.93-0ubuntu0.18.04.1 [76.9 MB]\n","Get:3 http://archive.ubuntu.com/ubuntu bionic-updates/universe amd64 chromium-browser-l10n all 90.0.4430.93-0ubuntu0.18.04.1 [3,853 kB]\n","Get:4 http://archive.ubuntu.com/ubuntu bionic-updates/universe amd64 chromium-chromedriver amd64 90.0.4430.93-0ubuntu0.18.04.1 [4,743 kB]\n","Fetched 86.6 MB in 5s (17.4 MB/s)\n","Selecting previously unselected package chromium-codecs-ffmpeg-extra.\n","(Reading database ... 160706 files and directories currently installed.)\n","Preparing to unpack .../chromium-codecs-ffmpeg-extra_90.0.4430.93-0ubuntu0.18.04.1_amd64.deb ...\n","Unpacking chromium-codecs-ffmpeg-extra (90.0.4430.93-0ubuntu0.18.04.1) ...\n","Selecting previously unselected package chromium-browser.\n","Preparing to unpack .../chromium-browser_90.0.4430.93-0ubuntu0.18.04.1_amd64.deb ...\n","Unpacking chromium-browser (90.0.4430.93-0ubuntu0.18.04.1) ...\n","Selecting previously unselected package chromium-browser-l10n.\n","Preparing to unpack .../chromium-browser-l10n_90.0.4430.93-0ubuntu0.18.04.1_all.deb ...\n","Unpacking chromium-browser-l10n (90.0.4430.93-0ubuntu0.18.04.1) ...\n","Selecting previously unselected package chromium-chromedriver.\n","Preparing to unpack .../chromium-chromedriver_90.0.4430.93-0ubuntu0.18.04.1_amd64.deb ...\n","Unpacking chromium-chromedriver (90.0.4430.93-0ubuntu0.18.04.1) ...\n","Setting up chromium-codecs-ffmpeg-extra (90.0.4430.93-0ubuntu0.18.04.1) ...\n","Setting up chromium-browser (90.0.4430.93-0ubuntu0.18.04.1) ...\n","update-alternatives: using /usr/bin/chromium-browser to provide /usr/bin/x-www-browser (x-www-browser) in auto mode\n","update-alternatives: using /usr/bin/chromium-browser to provide /usr/bin/gnome-www-browser (gnome-www-browser) in auto mode\n","Setting up chromium-chromedriver (90.0.4430.93-0ubuntu0.18.04.1) ...\n","Setting up chromium-browser-l10n (90.0.4430.93-0ubuntu0.18.04.1) ...\n","Processing triggers for man-db (2.8.3-2ubuntu0.1) ...\n","Processing triggers for hicolor-icon-theme (0.17-2) ...\n","Processing triggers for mime-support (3.60ubuntu1) ...\n","Processing triggers for libc-bin (2.27-3ubuntu1.2) ...\n","/sbin/ldconfig.real: /usr/local/lib/python3.7/dist-packages/ideep4py/lib/libmkldnn.so.0 is not a symbolic link\n","\n","cp: '/usr/lib/chromium-browser/chromedriver' and '/usr/bin/chromedriver' are the same file\n"],"name":"stdout"}]},{"cell_type":"code","metadata":{"id":"rvoGWdcz2OtD","colab":{"base_uri":"https://localhost:8080/","height":1000},"executionInfo":{"status":"ok","timestamp":1621430193232,"user_tz":-420,"elapsed":3368349,"user":{"displayName":"oktaria mong","photoUrl":"https://lh3.googleusercontent.com/a-/AOh14GjlHl7oQkC48hGy4Tpo0W4L3hlUryoPYs46z6v3=s64","userId":"14816202966115707672"}},"outputId":"8f07bd6f-72a1-4db9-a25d-1a84bba9f317"},"source":["from selenium import webdriver\n","import sys\n","from selenium.webdriver.chrome.options import Options\n","from google.colab.patches import cv2_imshow\n","import numpy as np\n","\n","import random\n","import time\n","from datetime import datetime\n","\n","\n","import pandas as pd\n","from selenium.webdriver.support.ui import WebDriverWait\n","from selenium.webdriver.common.by import By\n","from selenium.webdriver.common.keys import Keys\n","from selenium.common import exceptions\n","from selenium.webdriver.support import expected_conditions as EC\n","\n","from PIL import Image\n","from io import BytesIO\n","from google.colab import files\n","chrome_options = Options()\n","chrome_options.add_argument('--headless')\n","chrome_options.add_argument('--no-sandbox')\n","chrome_options.add_argument('--disable-dev-shm-usage')\n","chrome_options.add_argument(\"--use-fake-ui-for-media-stream\")\n","chrome_options.add_argument(\"window-size=1920,1080\");\n","chrome_options.add_experimental_option(\"excludeSwitches\", [\"enable-automation\"])\n","chrome_options.add_experimental_option('useAutomationExtension', False)\n","driver = webdriver.Chrome('chromedriver',options=chrome_options)\n","\n","\n","\n","driver.get(\"https://shopee.co.id/product/51925611/7042410240?smtt=0.94970112-1619415674.9&fbclid=IwAR1BQgAdbrCo7IJzQI44bTIOahib09mWHwDPv27uhBjrkGe_IChfHH_PZis\")\n","\n","second_lama = str(datetime.now())[17:19]\n","mulai = True\n","iterasi = 1\n","iterasi_x = 0\n","while mulai:\n"," iterasi_x += 1\n"," if str(datetime.now())[17:19] != second_lama:\n"," second_lama = str(datetime.now())[17:19]\n"," hour = str(datetime.now())[11:13]\n"," minute = str(datetime.now())[14:16]\n"," print(\"wait : \"+str(iterasi))\n"," iterasi_x = 0\n"," iterasi += 1\n"," if iterasi == 3:\n"," break\n","\n","second_lama = str(datetime.now())[17:19]\n","print(\"========\")\n","# time.sleep(10)\n","\n","mulai = True\n","iterasi = 1\n","iterasi_x = 0\n","while mulai:\n"," iterasi_x += 1\n"," if str(datetime.now())[17:19] != second_lama:\n"," second_lama = str(datetime.now())[17:19]\n"," hour = str(datetime.now())[11:13]\n"," minute = str(datetime.now())[14:16]\n"," # print(hour+\":\"+minute+\":\"+second_lama)\n"," print(\"wait : \"+str(iterasi)+\" s\")\n"," iterasi_x = 0\n"," iterasi += 1\n","\n"," driver.execute_script(\"window.scrollBy(0,\"+str(iterasi*10)+\")\")\n"," if iterasi == 30:\n"," break\n","\n","\n","els = driver.find_elements_by_css_selector('div.product-rating-overview__filter--with-comment')\n","for el in els:\n"," print(el.text)\n"," driver.execute_script(\"arguments[0].click();\", el)\n","\n","\n","png = driver.get_screenshot_as_png() # saves screenshot of entire page\n","im = Image.open(BytesIO(png))\n","im.save('screenshot.png') # saves new cropped image\n","\n","print(\"=====screenshot finished\")\n","\n","subscribe = WebDriverWait(driver, 60).until(EC.visibility_of_element_located((By.XPATH, \"//div[contains(@class, 'product-ratings')]\")))\n","\n","data_komentar = []\n","page = 1\n","page_lama = 0\n","while True:\n"," elements = driver.find_elements_by_css_selector('button.shopee-icon-button--right')\n"," for element in elements:\n"," # driver.execute_script(\"window.scrollBy(0,\"+str(iterasi*10)+\")\")\n"," element1s = driver.find_elements_by_css_selector('div.shopee-product-rating')\n"," for element1 in element1s:\n"," is_nama = True\n"," nama_review = ''\n"," element2s = element1.find_elements_by_css_selector('a.shopee-product-rating__author-name')\n"," for element2 in element2s:\n"," nama_review = element2.text\n"," is_nama = False\n","\n"," if is_nama:\n"," element2s = element1.find_elements_by_css_selector('div.shopee-product-rating__author-name')\n"," for element2 in element2s:\n"," nama_review = element2.text\n","\n","\n"," element3s = element1.find_elements_by_css_selector('div._1pnfng')\n"," is_get_review = True\n"," review = ''\n"," for element3 in element3s:\n"," review = element3.text\n"," is_get_review = False\n","\n"," if is_get_review:\n"," element33s = element1.find_elements_by_css_selector('div.shopee-product-rating__content')\n"," review = ''\n"," for element33 in element33s:\n"," review = element33.text\n","\n"," jumlah_rating = 0\n"," element5s = element1.find_elements_by_css_selector('svg.icon-rating-solid--active')\n"," for element5 in element5s:\n"," jumlah_rating +=1\n","\n"," data_komentar.append({\"nama_review\":nama_review,\"review\":review,\"jumlah_rating\":jumlah_rating})\n","\n"," element4s = driver.find_elements_by_css_selector('button.shopee-button-solid--primary')\n"," for element4 in element4s:\n"," page = element4.text\n"," if int(page_lama) == int(page):\n"," break\n"," # if 4 == int(page):\n"," # break\n"," driver.execute_script(\"arguments[0].click();\", element)\n"," im = Image.open(BytesIO(driver.get_screenshot_as_png()))\n"," im.save('screenshot_'+str(page)+'.png') # saves new cropped image\n"," print(\"=====================\",page_lama,page)\n"," page_lama = page\n"," time.sleep(5)\n","\n","\n","# print(data_komentar)\n","df = pd.DataFrame.from_dict(data_komentar, orient='columns')\n","df.to_csv('f_final_review_shopee.csv', sep=',', encoding='utf-8')\n","files.download('f_final_review_shopee.csv') "],"execution_count":null,"outputs":[{"output_type":"stream","text":["wait : 1\n","wait : 2\n","========\n","wait : 1 s\n","wait : 2 s\n","wait : 3 s\n","wait : 4 s\n","wait : 5 s\n","wait : 6 s\n","wait : 7 s\n","wait : 8 s\n","wait : 9 s\n","wait : 10 s\n","wait : 11 s\n","wait : 12 s\n","wait : 13 s\n","wait : 14 s\n","wait : 15 s\n","wait : 16 s\n","wait : 17 s\n","wait : 18 s\n","wait : 19 s\n","wait : 20 s\n","wait : 21 s\n","wait : 22 s\n","wait : 23 s\n","wait : 24 s\n","wait : 25 s\n","wait : 26 s\n","wait : 27 s\n","wait : 28 s\n","wait : 29 s\n","Dengan Komentar (3,5RB)\n","=====screenshot finished\n","===================== 0 1\n","===================== 1 2\n","===================== 2 3\n","===================== 3 4\n","===================== 4 5\n","===================== 5 6\n","===================== 6 7\n","===================== 7 8\n","===================== 8 9\n","===================== 9 10\n","===================== 10 11\n","===================== 11 12\n","===================== 12 13\n","===================== 13 14\n","===================== 14 15\n","===================== 15 16\n","===================== 16 17\n","===================== 17 18\n","===================== 18 19\n","===================== 19 20\n","===================== 20 21\n","===================== 21 22\n","===================== 22 23\n","===================== 23 24\n","===================== 24 25\n","===================== 25 26\n","===================== 26 27\n","===================== 27 28\n","===================== 28 29\n","===================== 29 30\n","===================== 30 31\n","===================== 31 32\n","===================== 32 33\n","===================== 33 34\n","===================== 34 35\n","===================== 35 36\n","===================== 36 37\n","===================== 37 38\n","===================== 38 39\n","===================== 39 40\n","===================== 40 41\n","===================== 41 42\n","===================== 42 43\n","===================== 43 44\n","===================== 44 45\n","===================== 45 46\n","===================== 46 47\n","===================== 47 48\n","===================== 48 49\n","===================== 49 50\n","===================== 50 51\n","===================== 51 52\n","===================== 52 53\n","===================== 53 54\n","===================== 54 55\n","===================== 55 56\n","===================== 56 57\n","===================== 57 58\n","===================== 58 59\n","===================== 59 60\n","===================== 60 61\n","===================== 61 62\n","===================== 62 63\n","===================== 63 64\n","===================== 64 65\n","===================== 65 66\n","===================== 66 67\n","===================== 67 68\n","===================== 68 69\n","===================== 69 70\n","===================== 70 71\n","===================== 71 72\n","===================== 72 73\n","===================== 73 74\n","===================== 74 75\n","===================== 75 76\n","===================== 76 77\n","===================== 77 78\n","===================== 78 79\n","===================== 79 80\n","===================== 80 81\n","===================== 81 82\n","===================== 82 83\n","===================== 83 84\n","===================== 84 85\n","===================== 85 86\n","===================== 86 87\n","===================== 87 88\n","===================== 88 89\n","===================== 89 90\n","===================== 90 91\n","===================== 91 92\n","===================== 92 93\n","===================== 93 94\n","===================== 94 95\n","===================== 95 96\n","===================== 96 97\n","===================== 97 98\n","===================== 98 99\n","===================== 99 100\n","===================== 100 101\n","===================== 101 102\n","===================== 102 103\n","===================== 103 104\n","===================== 104 105\n","===================== 105 106\n","===================== 106 107\n","===================== 107 108\n","===================== 108 109\n","===================== 109 110\n","===================== 110 111\n","===================== 111 112\n","===================== 112 113\n","===================== 113 114\n","===================== 114 115\n","===================== 115 116\n","===================== 116 117\n","===================== 117 118\n","===================== 118 119\n","===================== 119 120\n","===================== 120 121\n","===================== 121 122\n","===================== 122 123\n","===================== 123 124\n","===================== 124 125\n","===================== 125 126\n","===================== 126 127\n","===================== 127 128\n","===================== 128 129\n","===================== 129 130\n","===================== 130 131\n","===================== 131 132\n","===================== 132 133\n","===================== 133 134\n","===================== 134 135\n","===================== 135 136\n","===================== 136 137\n","===================== 137 138\n","===================== 138 139\n","===================== 139 140\n","===================== 140 141\n","===================== 141 142\n","===================== 142 143\n","===================== 143 144\n","===================== 144 145\n","===================== 145 146\n","===================== 146 147\n","===================== 147 148\n","===================== 148 149\n","===================== 149 150\n","===================== 150 151\n","===================== 151 152\n","===================== 152 153\n","===================== 153 154\n","===================== 154 155\n","===================== 155 156\n","===================== 156 157\n","===================== 157 158\n","===================== 158 159\n","===================== 159 160\n","===================== 160 161\n","===================== 161 162\n","===================== 162 163\n","===================== 163 164\n","===================== 164 165\n","===================== 165 166\n","===================== 166 167\n","===================== 167 168\n","===================== 168 169\n","===================== 169 170\n","===================== 170 171\n","===================== 171 172\n","===================== 172 173\n","===================== 173 174\n","===================== 174 175\n","===================== 175 176\n","===================== 176 177\n","===================== 177 178\n","===================== 178 179\n","===================== 179 180\n","===================== 180 181\n","===================== 181 182\n","===================== 182 183\n","===================== 183 184\n","===================== 184 185\n","===================== 185 186\n","===================== 186 187\n","===================== 187 188\n","===================== 188 189\n","===================== 189 190\n","===================== 190 191\n","===================== 191 192\n","===================== 192 193\n","===================== 193 194\n","===================== 194 195\n","===================== 195 196\n","===================== 196 197\n","===================== 197 198\n","===================== 198 199\n","===================== 199 200\n","===================== 200 201\n","===================== 201 202\n","===================== 202 203\n","===================== 203 204\n","===================== 204 205\n","===================== 205 206\n","===================== 206 207\n","===================== 207 208\n","===================== 208 209\n","===================== 209 210\n","===================== 210 211\n","===================== 211 212\n","===================== 212 213\n","===================== 213 214\n","===================== 214 215\n","===================== 215 216\n","===================== 216 217\n","===================== 217 218\n","===================== 218 219\n","===================== 219 220\n","===================== 220 221\n","===================== 221 222\n","===================== 222 223\n","===================== 223 224\n","===================== 224 225\n","===================== 225 226\n","===================== 226 227\n","===================== 227 228\n","===================== 228 229\n","===================== 229 230\n","===================== 230 231\n","===================== 231 232\n","===================== 232 233\n","===================== 233 234\n","===================== 234 235\n","===================== 235 236\n","===================== 236 237\n","===================== 237 238\n","===================== 238 239\n","===================== 239 240\n","===================== 240 241\n","===================== 241 242\n","===================== 242 243\n","===================== 243 244\n","===================== 244 245\n","===================== 245 246\n","===================== 246 247\n","===================== 247 248\n","===================== 248 249\n","===================== 249 250\n","===================== 250 251\n","===================== 251 252\n","===================== 252 253\n","===================== 253 254\n","===================== 254 255\n","===================== 255 256\n","===================== 256 257\n","===================== 257 258\n","===================== 258 259\n","===================== 259 260\n","===================== 260 261\n","===================== 261 262\n","===================== 262 263\n","===================== 263 264\n","===================== 264 265\n","===================== 265 266\n","===================== 266 267\n","===================== 267 268\n","===================== 268 269\n","===================== 269 270\n","===================== 270 271\n","===================== 271 272\n","===================== 272 273\n","===================== 273 274\n","===================== 274 275\n","===================== 275 276\n","===================== 276 277\n","===================== 277 278\n","===================== 278 279\n","===================== 279 280\n","===================== 280 281\n","===================== 281 282\n","===================== 282 283\n","===================== 283 284\n","===================== 284 285\n","===================== 285 286\n","===================== 286 287\n","===================== 287 288\n","===================== 288 289\n","===================== 289 290\n","===================== 290 291\n","===================== 291 292\n","===================== 292 293\n","===================== 293 294\n","===================== 294 295\n","===================== 295 296\n","===================== 296 297\n","===================== 297 298\n","===================== 298 299\n","===================== 299 300\n","===================== 300 301\n","===================== 301 302\n","===================== 302 303\n","===================== 303 304\n","===================== 304 305\n","===================== 305 306\n","===================== 306 307\n","===================== 307 308\n","===================== 308 309\n","===================== 309 310\n","===================== 310 311\n","===================== 311 312\n","===================== 312 313\n","===================== 313 314\n","===================== 314 315\n","===================== 315 316\n","===================== 316 317\n","===================== 317 318\n","===================== 318 319\n","===================== 319 320\n","===================== 320 321\n","===================== 321 322\n","===================== 322 323\n","===================== 323 324\n","===================== 324 325\n","===================== 325 326\n","===================== 326 327\n","===================== 327 328\n","===================== 328 329\n","===================== 329 330\n","===================== 330 331\n","===================== 331 332\n","===================== 332 333\n","===================== 333 334\n","===================== 334 335\n","===================== 335 336\n","===================== 336 337\n","===================== 337 338\n","===================== 338 339\n","===================== 339 340\n","===================== 340 341\n","===================== 341 342\n","===================== 342 343\n","===================== 343 344\n","===================== 344 345\n","===================== 345 346\n","===================== 346 347\n","===================== 347 348\n","===================== 348 349\n","===================== 349 350\n","===================== 350 351\n","===================== 351 352\n","===================== 352 353\n","===================== 353 354\n","===================== 354 355\n","===================== 355 356\n","===================== 356 357\n","===================== 357 358\n","===================== 358 359\n","===================== 359 360\n","===================== 360 361\n","===================== 361 362\n","===================== 362 363\n","===================== 363 364\n","===================== 364 365\n","===================== 365 366\n","===================== 366 367\n","===================== 367 368\n","===================== 368 369\n","===================== 369 370\n","===================== 370 371\n","===================== 371 372\n","===================== 372 373\n","===================== 373 374\n","===================== 374 375\n","===================== 375 376\n","===================== 376 377\n","===================== 377 378\n","===================== 378 379\n","===================== 379 380\n","===================== 380 381\n","===================== 381 382\n","===================== 382 383\n","===================== 383 384\n","===================== 384 385\n","===================== 385 386\n","===================== 386 387\n","===================== 387 388\n","===================== 388 389\n","===================== 389 390\n","===================== 390 391\n","===================== 391 392\n","===================== 392 393\n","===================== 393 394\n","===================== 394 395\n","===================== 395 396\n","===================== 396 397\n","===================== 397 398\n","===================== 398 399\n","===================== 399 400\n","===================== 400 401\n","===================== 401 402\n","===================== 402 403\n","===================== 403 404\n","===================== 404 405\n","===================== 405 406\n","===================== 406 407\n","===================== 407 408\n","===================== 408 409\n","===================== 409 410\n","===================== 410 411\n","===================== 411 412\n","===================== 412 413\n","===================== 413 414\n","===================== 414 415\n","===================== 415 416\n","===================== 416 417\n","===================== 417 418\n","===================== 418 419\n","===================== 419 420\n","===================== 420 421\n","===================== 421 422\n","===================== 422 423\n","===================== 423 424\n","===================== 424 425\n","===================== 425 426\n","===================== 426 427\n","===================== 427 428\n","===================== 428 429\n","===================== 429 430\n","===================== 430 431\n","===================== 431 432\n","===================== 432 433\n","===================== 433 434\n","===================== 434 435\n","===================== 435 436\n","===================== 436 437\n","===================== 437 438\n","===================== 438 439\n","===================== 439 440\n","===================== 440 441\n","===================== 441 442\n","===================== 442 443\n","===================== 443 444\n","===================== 444 445\n","===================== 445 446\n","===================== 446 447\n","===================== 447 448\n","===================== 448 449\n","===================== 449 450\n","===================== 450 451\n","===================== 451 452\n","===================== 452 453\n","===================== 453 454\n","===================== 454 455\n","===================== 455 456\n","===================== 456 457\n","===================== 457 458\n","===================== 458 459\n","===================== 459 460\n","===================== 460 461\n","===================== 461 462\n","===================== 462 463\n","===================== 463 464\n","===================== 464 465\n","===================== 465 466\n","===================== 466 467\n","===================== 467 468\n","===================== 468 469\n","===================== 469 470\n","===================== 470 471\n","===================== 471 472\n","===================== 472 473\n","===================== 473 474\n","===================== 474 475\n","===================== 475 476\n","===================== 476 477\n","===================== 477 478\n","===================== 478 479\n","===================== 479 480\n","===================== 480 481\n","===================== 481 482\n","===================== 482 483\n","===================== 483 484\n","===================== 484 485\n","===================== 485 486\n","===================== 486 487\n","===================== 487 488\n","===================== 488 489\n","===================== 489 490\n","===================== 490 491\n","===================== 491 492\n","===================== 492 493\n","===================== 493 494\n","===================== 494 495\n","===================== 495 496\n","===================== 496 497\n","===================== 497 498\n","===================== 498 499\n","===================== 499 500\n","===================== 500 501\n"],"name":"stdout"},{"output_type":"display_data","data":{"application/javascript":["\n"," async function download(id, filename, size) {\n"," if (!google.colab.kernel.accessAllowed) {\n"," return;\n"," }\n"," const div = document.createElement('div');\n"," const label = document.createElement('label');\n"," label.textContent = `Downloading \"${filename}\": `;\n"," div.appendChild(label);\n"," const progress = document.createElement('progress');\n"," progress.max = size;\n"," div.appendChild(progress);\n"," document.body.appendChild(div);\n","\n"," const buffers = [];\n"," let downloaded = 0;\n","\n"," const channel = await google.colab.kernel.comms.open(id);\n"," // Send a message to notify the kernel that we're ready.\n"," channel.send({})\n","\n"," for await (const message of channel.messages) {\n"," // Send a message to notify the kernel that we're ready.\n"," channel.send({})\n"," if (message.buffers) {\n"," for (const buffer of message.buffers) {\n"," buffers.push(buffer);\n"," downloaded += buffer.byteLength;\n"," progress.value = downloaded;\n"," }\n"," }\n"," }\n"," const blob = new Blob(buffers, {type: 'application/binary'});\n"," const a = document.createElement('a');\n"," a.href = window.URL.createObjectURL(blob);\n"," a.download = filename;\n"," div.appendChild(a);\n"," a.click();\n"," div.remove();\n"," }\n"," "],"text/plain":[""]},"metadata":{"tags":[]}},{"output_type":"display_data","data":{"application/javascript":["download(\"download_5c429af1-6d2b-4bc0-bf8d-0688e468cda9\", \"f_final_review_shopee.csv\", 355120)"],"text/plain":[""]},"metadata":{"tags":[]}}]},{"cell_type":"code","metadata":{"id":"x6sHCjL7923Y"},"source":["df = pd.DataFrame.from_dict(data_komentar, orient='columns')\n","df.to_csv('f_final_review_shopee.csv', sep=',', encoding='utf-8')\n","files.download('f_final_review_shopee.csv') "],"execution_count":null,"outputs":[]},{"cell_type":"markdown","metadata":{"id":"jBUMLXCW2WFX"},"source":[""]}]}