Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,5 +1,9 @@
|
|
| 1 |
from selenium import webdriver
|
| 2 |
from selenium.webdriver.chrome.options import Options
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
from fastapi import FastAPI, Request
|
| 4 |
import uvicorn
|
| 5 |
|
|
@@ -11,6 +15,8 @@ def main():
|
|
| 11 |
options.add_argument('--headless')
|
| 12 |
driver = webdriver.Chrome(options=options)
|
| 13 |
driver.get('https://test5.container-z.art/test26')
|
|
|
|
|
|
|
| 14 |
|
| 15 |
cookies = driver.get_cookies()
|
| 16 |
print(cookies)
|
|
|
|
| 1 |
from selenium import webdriver
|
| 2 |
from selenium.webdriver.chrome.options import Options
|
| 3 |
+
from selenium.webdriver.common.by import By
|
| 4 |
+
from selenium.webdriver.support.ui import WebDriverWait
|
| 5 |
+
from selenium.webdriver.support import expected_conditions as EC
|
| 6 |
+
from selenium.common.exceptions import WebDriverException, TimeoutException
|
| 7 |
from fastapi import FastAPI, Request
|
| 8 |
import uvicorn
|
| 9 |
|
|
|
|
| 15 |
options.add_argument('--headless')
|
| 16 |
driver = webdriver.Chrome(options=options)
|
| 17 |
driver.get('https://test5.container-z.art/test26')
|
| 18 |
+
|
| 19 |
+
WebDriverWait(driver, 5).until(EC.presence_of_element_located((By.TAG_NAME, "body")))
|
| 20 |
|
| 21 |
cookies = driver.get_cookies()
|
| 22 |
print(cookies)
|