Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -27,6 +27,7 @@ def run_script(text: str):
|
|
| 27 |
try:
|
| 28 |
driver = webdriver.Chrome(options=options)
|
| 29 |
driver.get(text)
|
|
|
|
| 30 |
driver.implicitly_wait(30)
|
| 31 |
driver.set_window_size(1920, 1080)
|
| 32 |
######################
|
|
@@ -49,9 +50,9 @@ def run_script(text: str):
|
|
| 49 |
if driver:
|
| 50 |
driver.quit()
|
| 51 |
|
| 52 |
-
return [Image.open(BytesIO(screenshot)), 'operation success.',cookie_jar]
|
| 53 |
else:
|
| 54 |
-
return [None, 'Please enter a valid URL of a website/host.',None]
|
| 55 |
|
| 56 |
with gr.Blocks() as app:
|
| 57 |
inp = gr.Textbox()
|
|
@@ -62,5 +63,6 @@ with gr.Blocks() as app:
|
|
| 62 |
with gr.Column():
|
| 63 |
outp = gr.Textbox()
|
| 64 |
cook = gr.JSON()
|
| 65 |
-
|
|
|
|
| 66 |
app.launch()
|
|
|
|
| 27 |
try:
|
| 28 |
driver = webdriver.Chrome(options=options)
|
| 29 |
driver.get(text)
|
| 30 |
+
html=driver.page_source()
|
| 31 |
driver.implicitly_wait(30)
|
| 32 |
driver.set_window_size(1920, 1080)
|
| 33 |
######################
|
|
|
|
| 50 |
if driver:
|
| 51 |
driver.quit()
|
| 52 |
|
| 53 |
+
return [Image.open(BytesIO(screenshot)), 'operation success.',cookie_jar,html]
|
| 54 |
else:
|
| 55 |
+
return [None, 'Please enter a valid URL of a website/host.',None,None]
|
| 56 |
|
| 57 |
with gr.Blocks() as app:
|
| 58 |
inp = gr.Textbox()
|
|
|
|
| 63 |
with gr.Column():
|
| 64 |
outp = gr.Textbox()
|
| 65 |
cook = gr.JSON()
|
| 66 |
+
html=gr.Textbox()
|
| 67 |
+
btn.click(run_script,inp,[outim,outp,cook,html])
|
| 68 |
app.launch()
|