Spaces:
Sleeping
Sleeping
Upload folder using huggingface_hub
Browse files- app.py +7 -3
- requirements.txt +2 -1
app.py
CHANGED
|
@@ -1,4 +1,5 @@
|
|
| 1 |
from selenium import webdriver
|
|
|
|
| 2 |
from selenium.webdriver.chrome.options import Options
|
| 3 |
from selenium.webdriver.common.keys import Keys
|
| 4 |
from selenium.webdriver.common.by import By
|
|
@@ -7,11 +8,14 @@ from selenium.webdriver.support import expected_conditions as EC
|
|
| 7 |
from gradio_client import Client
|
| 8 |
import json
|
| 9 |
import gradio as gr
|
|
|
|
| 10 |
|
| 11 |
def scrape_data(amazon_url):
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
|
|
|
|
|
|
| 15 |
|
| 16 |
driver.get(amazon_url)
|
| 17 |
|
|
|
|
| 1 |
from selenium import webdriver
|
| 2 |
+
from selenium.webdriver.chrome.service import Service
|
| 3 |
from selenium.webdriver.chrome.options import Options
|
| 4 |
from selenium.webdriver.common.keys import Keys
|
| 5 |
from selenium.webdriver.common.by import By
|
|
|
|
| 8 |
from gradio_client import Client
|
| 9 |
import json
|
| 10 |
import gradio as gr
|
| 11 |
+
from webdriver_manager.chrome import ChromeDriverManager
|
| 12 |
|
| 13 |
def scrape_data(amazon_url):
|
| 14 |
+
service = Service(ChromeDriverManager().install())
|
| 15 |
+
options = Options()
|
| 16 |
+
options.add_argument("--headless")
|
| 17 |
+
|
| 18 |
+
driver = webdriver.Chrome(service=service, options=options)
|
| 19 |
|
| 20 |
driver.get(amazon_url)
|
| 21 |
|
requirements.txt
CHANGED
|
@@ -6,4 +6,5 @@ gradio_client
|
|
| 6 |
uvicorn
|
| 7 |
gunicorn
|
| 8 |
chromedriver-py
|
| 9 |
-
webdriver-manager
|
|
|
|
|
|
| 6 |
uvicorn
|
| 7 |
gunicorn
|
| 8 |
chromedriver-py
|
| 9 |
+
webdriver-manager
|
| 10 |
+
webdriver_manager
|