Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -13,7 +13,7 @@ import streamlit as st
|
|
| 13 |
warnings.simplefilter("ignore")
|
| 14 |
|
| 15 |
try:
|
| 16 |
-
Link = ""
|
| 17 |
chrome_driver_path = 'chromedriver.exe'
|
| 18 |
chrome_options = Options()
|
| 19 |
chrome_options.headless = True
|
|
@@ -60,7 +60,7 @@ def ChatGPTBrain(Query):
|
|
| 60 |
Query = str(Query)
|
| 61 |
|
| 62 |
try:
|
| 63 |
-
driver.find_element(by=By.XPATH,value="/html/body/div[1]/div/div/main/
|
| 64 |
sleep(1)
|
| 65 |
|
| 66 |
except:
|
|
@@ -68,7 +68,7 @@ def ChatGPTBrain(Query):
|
|
| 68 |
st.write("*Consider modifying the path for the 'Input' element, which is available on the website.*")
|
| 69 |
|
| 70 |
try:
|
| 71 |
-
driver.find_element(by=By.XPATH,value="/html/body/div[1]/div/div/main/
|
| 72 |
|
| 73 |
except:
|
| 74 |
st.write("*The Send.Keys() function or button does not appear to be readily accessible or available within the current context or environment.*")
|
|
@@ -87,7 +87,7 @@ def ChatGPTBrain(Query):
|
|
| 87 |
try:
|
| 88 |
|
| 89 |
try:
|
| 90 |
-
AnswerXpath = f"/html/body/div[1]/div/div/main/
|
| 91 |
Answer = driver.find_element(by=By.XPATH,value=AnswerXpath).is_displayed()
|
| 92 |
if str(Answer)=="True":
|
| 93 |
break
|
|
@@ -100,7 +100,7 @@ def ChatGPTBrain(Query):
|
|
| 100 |
pass
|
| 101 |
|
| 102 |
try:
|
| 103 |
-
AnswerXpath = f"/html/body/div[1]/div/div/main/
|
| 104 |
Answer = driver.find_element(by=By.XPATH,value=AnswerXpath).text
|
| 105 |
|
| 106 |
except:
|
|
|
|
| 13 |
warnings.simplefilter("ignore")
|
| 14 |
|
| 15 |
try:
|
| 16 |
+
Link = "https://chat.openai.com/c/58ea6e4a-67e3-460e-99c8-8e701f863534"
|
| 17 |
chrome_driver_path = 'chromedriver.exe'
|
| 18 |
chrome_options = Options()
|
| 19 |
chrome_options.headless = True
|
|
|
|
| 60 |
Query = str(Query)
|
| 61 |
|
| 62 |
try:
|
| 63 |
+
driver.find_element(by=By.XPATH,value="/html/body/div[1]/div[1]/div/main/div[1]/div[2]/form/div/div[1]/div/textarea").send_keys(Query)
|
| 64 |
sleep(1)
|
| 65 |
|
| 66 |
except:
|
|
|
|
| 68 |
st.write("*Consider modifying the path for the 'Input' element, which is available on the website.*")
|
| 69 |
|
| 70 |
try:
|
| 71 |
+
driver.find_element(by=By.XPATH,value="/html/body/div[1]/div[1]/div/main/div[1]/div[2]/form/div/div[1]/div/button").click()
|
| 72 |
|
| 73 |
except:
|
| 74 |
st.write("*The Send.Keys() function or button does not appear to be readily accessible or available within the current context or environment.*")
|
|
|
|
| 87 |
try:
|
| 88 |
|
| 89 |
try:
|
| 90 |
+
AnswerXpath = f"/html/body/div[1]/div[1]/div/main/div[1]/div[1]/div/div/div/div[2]/div{Data}"
|
| 91 |
Answer = driver.find_element(by=By.XPATH,value=AnswerXpath).is_displayed()
|
| 92 |
if str(Answer)=="True":
|
| 93 |
break
|
|
|
|
| 100 |
pass
|
| 101 |
|
| 102 |
try:
|
| 103 |
+
AnswerXpath = f"/html/body/div[1]/div[1]/div/main/div[1]/div[1]/div/div/div/div[4]/div{Data}"
|
| 104 |
Answer = driver.find_element(by=By.XPATH,value=AnswerXpath).text
|
| 105 |
|
| 106 |
except:
|