Update app.py
Browse files
app.py
CHANGED
@@ -7,7 +7,6 @@ from selenium.webdriver.support.wait import WebDriverWait
|
|
7 |
from selenium.webdriver.support import expected_conditions as EC
|
8 |
from selenium.webdriver.chrome.options import Options
|
9 |
|
10 |
-
|
11 |
def selenium(message):
|
12 |
options = webdriver.ChromeOptions()
|
13 |
options.add_argument('--headless')
|
@@ -19,19 +18,16 @@ def selenium(message):
|
|
19 |
#<ol class="AmbQnf">
|
20 |
wd.get(url)
|
21 |
wd.implicitly_wait(5)
|
22 |
-
element = driver.find_element(By.
|
23 |
time.sleep(2)
|
24 |
return element.text
|
25 |
-
|
26 |
-
|
27 |
|
28 |
except WebDriverException as e:
|
29 |
return "fehler"
|
30 |
finally:
|
31 |
if wd:
|
32 |
wd.quit()
|
33 |
-
|
34 |
-
|
35 |
iface = gr.Interface(
|
36 |
fn=selenium,
|
37 |
inputs="text",
|
|
|
7 |
from selenium.webdriver.support import expected_conditions as EC
|
8 |
from selenium.webdriver.chrome.options import Options
|
9 |
|
|
|
10 |
def selenium(message):
|
11 |
options = webdriver.ChromeOptions()
|
12 |
options.add_argument('--headless')
|
|
|
18 |
#<ol class="AmbQnf">
|
19 |
wd.get(url)
|
20 |
wd.implicitly_wait(5)
|
21 |
+
element = driver.find_element(By.TAG_NAME, "body")
|
22 |
time.sleep(2)
|
23 |
return element.text
|
|
|
|
|
24 |
|
25 |
except WebDriverException as e:
|
26 |
return "fehler"
|
27 |
finally:
|
28 |
if wd:
|
29 |
wd.quit()
|
30 |
+
|
|
|
31 |
iface = gr.Interface(
|
32 |
fn=selenium,
|
33 |
inputs="text",
|