naufalnashif commited on
Commit
b5f962a
·
1 Parent(s): 278bf08

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -178,7 +178,8 @@ def scrape_tokped_with_selenium(nama_barang, num_items):
178
  # Di sini, saya menggunakan XPath sebagai contoh:
179
  product_container_xpath = "//body//*" # Ganti dengan XPath yang sesuai
180
  #html = driver.find_elements_by_xpath('//body//*')
181
- html = driver.find_element(By.XPATH, product_container_xpath)
 
182
  st.write(html)
183
  # Gunakan BeautifulSoup untuk melakukan parsing HTML
184
  soup = BeautifulSoup(html, "html.parser")
 
178
  # Di sini, saya menggunakan XPath sebagai contoh:
179
  product_container_xpath = "//body//*" # Ganti dengan XPath yang sesuai
180
  #html = driver.find_elements_by_xpath('//body//*')
181
+ #html = driver.find_element(By.XPATH, product_container_xpath)
182
+ html = driver.execute_script("return document.getElementsByTagName('html')[0].innerHTML")
183
  st.write(html)
184
  # Gunakan BeautifulSoup untuk melakukan parsing HTML
185
  soup = BeautifulSoup(html, "html.parser")