naufalnashif commited on
Commit
7190751
·
1 Parent(s): 8a9efb5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -7
app.py CHANGED
@@ -11,20 +11,16 @@ def scrape_e_commerce(nama_barang, num_items):
11
  products = []
12
  page = 1
13
  query = quote(nama_barang)
14
-
 
15
 
16
  while len(products) < num_items :
17
  if len (products) > num_items :
18
  products = products[:num_items]
19
- break
20
-
21
- progress_text = "Scraping in progress. Please wait."
22
- my_bar = st.progress(len(products), text=progress_text)
23
 
24
  prop = min(len(products) / num_items,1)
25
  my_bar.progress(prop, text=progress_text)
26
-
27
-
28
 
29
  url = f"https://www.klikindomaret.com/search/?key={query}&categories=&productbrandid=&sortcol=&pagesize=54&page={page}&startprice=&endprice=&attributes=&ShowItem="
30
  response = requests.get(url)
 
11
  products = []
12
  page = 1
13
  query = quote(nama_barang)
14
+ progress_text = "Scraping in progress. Please wait."
15
+ my_bar = st.progress(len(products), text=progress_text)
16
 
17
  while len(products) < num_items :
18
  if len (products) > num_items :
19
  products = products[:num_items]
20
+ break
 
 
 
21
 
22
  prop = min(len(products) / num_items,1)
23
  my_bar.progress(prop, text=progress_text)
 
 
24
 
25
  url = f"https://www.klikindomaret.com/search/?key={query}&categories=&productbrandid=&sortcol=&pagesize=54&page={page}&startprice=&endprice=&attributes=&ShowItem="
26
  response = requests.get(url)