Update app.py
Browse files
app.py
CHANGED
@@ -34,28 +34,19 @@ def update(prompt, ort):
|
|
34 |
|
35 |
def selenium(message):
|
36 |
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
results = update(element.text, message)
|
51 |
-
return results
|
52 |
-
|
53 |
-
except WebDriverException as e:
|
54 |
-
return "fehler"
|
55 |
-
finally:
|
56 |
-
if wd:
|
57 |
-
wd.quit()
|
58 |
-
|
59 |
iface = gr.Interface(
|
60 |
fn=selenium,
|
61 |
inputs="text",
|
|
|
34 |
|
35 |
def selenium(message):
|
36 |
|
37 |
+
texts=""
|
38 |
+
url = f"https://www.google.com/search?q=zugverbindung+bad+kissingen+{message}"
|
39 |
+
#url = 'https://www.spiegel.de'
|
40 |
+
#<ol class="AmbQnf">
|
41 |
+
wd.get(url)
|
42 |
+
wd.implicitly_wait(3)
|
43 |
+
element = wd.find_element(By.TAG_NAME, "body")
|
44 |
+
#wd.quit()
|
45 |
+
time.sleep(3)
|
46 |
+
return element.text
|
47 |
+
results = update(element.text, message)
|
48 |
+
return results
|
49 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
50 |
iface = gr.Interface(
|
51 |
fn=selenium,
|
52 |
inputs="text",
|