Commit
·
d8298cf
1
Parent(s):
acaad0a
Update app.py
Browse files
app.py
CHANGED
@@ -12,7 +12,7 @@ def scrape_e_commerce(nama_barang, num_items):
|
|
12 |
page = 1
|
13 |
query = quote(nama_barang)
|
14 |
progress_text = "Scraping in progress. Please wait."
|
15 |
-
my_bar = st.progress(
|
16 |
|
17 |
#while len(products) < num_items :
|
18 |
for percent in range(num_items):
|
@@ -20,7 +20,7 @@ def scrape_e_commerce(nama_barang, num_items):
|
|
20 |
products = products[:num_items]
|
21 |
break
|
22 |
|
23 |
-
prop = min(len(products)
|
24 |
my_bar.progress(prop, text=progress_text)
|
25 |
|
26 |
url = f"https://www.klikindomaret.com/search/?key={query}&categories=&productbrandid=&sortcol=&pagesize=54&page={page}&startprice=&endprice=&attributes=&ShowItem="
|
|
|
12 |
page = 1
|
13 |
query = quote(nama_barang)
|
14 |
progress_text = "Scraping in progress. Please wait."
|
15 |
+
my_bar = st.progress(0, text=progress_text)
|
16 |
|
17 |
#while len(products) < num_items :
|
18 |
for percent in range(num_items):
|
|
|
20 |
products = products[:num_items]
|
21 |
break
|
22 |
|
23 |
+
prop = min(len(products)/num_items, 1)
|
24 |
my_bar.progress(prop, text=progress_text)
|
25 |
|
26 |
url = f"https://www.klikindomaret.com/search/?key={query}&categories=&productbrandid=&sortcol=&pagesize=54&page={page}&startprice=&endprice=&attributes=&ShowItem="
|