mgokg commited on
Commit
247bec9
·
verified ·
1 Parent(s): ebc7d14

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -10
app.py CHANGED
@@ -3,23 +3,24 @@ from selenium import webdriver
3
  from selenium.common.exceptions import WebDriverException
4
  from selenium.webdriver.common.by import By
5
  from gradio_client import Client
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')
14
- wd = webdriver.Chrome(options=options)
15
  try:
16
- #url = 'https://www.google.com/search?q=zugverbindung+bad+kissingen+euerdorf'
17
- url = 'https://www.spiegel.de'
 
18
  #<ol class="AmbQnf">
19
  wd.get(url)
20
- wd.implicitly_wait(10)
21
- element = driver.find_element(By.TAG_NAME, "body")
22
- time.sleep(5)
23
  return element.text
24
 
25
 
 
3
  from selenium.common.exceptions import WebDriverException
4
  from selenium.webdriver.common.by import By
5
  from gradio_client import Client
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 take_screenshot(url):
12
  options = webdriver.ChromeOptions()
13
  options.add_argument('--headless')
14
+
15
  try:
16
+ wd = webdriver.Chrome(options=options)
17
+ url = 'https://www.google.com/search?q=zugverbindung+bad+kissingen+euerdorf'
18
+ #url = 'https://www.spiegel.de'
19
  #<ol class="AmbQnf">
20
  wd.get(url)
21
+ wd.implicitly_wait(5)
22
+ element = driver.find_element(By.ID, "exp0")
23
+ time.sleep(2)
24
  return element.text
25
 
26