Spaces:
Sleeping
Sleeping
File size: 2,461 Bytes
9c7fd22 b70a4d5 9c7fd22 b70a4d5 d76f226 55309c0 a07056f 2c9bef0 b70a4d5 0e1d329 2c9bef0 b70a4d5 b92a7b2 0e1d329 b92a7b2 0e1d329 7922090 0e1d329 b70a4d5 e5f32ce 9c7fd22 b70a4d5 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 |
import streamlit as st
from selenium import webdriver
# import chromedriver_binary
from time import sleep
import subprocess
st.title("Try")
st.text("running commondsd .....")
script_path = 'render-build.sh'
subprocess.run(['sh', script_path], check=True)
# subprocess.run(command, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True)
cmd1 = subprocess.run("apt update", shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True)
if cmd1.returncode == 0:
print("Command output:")
print(cmd1.stdout)
else:
# Print the error message
print("Error executing command:")
print(cmd1.stderr)
sleep(5)
cmd2 = subprocess.run("apt-get install -y libglib2.0-0=2.50.3-2", shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True)
if cmd2.returncode == 0:
print("Command output:")
print(cmd2.stdout)
else:
# Print the error message
print("Error executing command:")
print(cmd2.stderr)
sleep(5)
cmd3 = subprocess.run("apt-get install -y chromium-browser", shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True)
if cmd3.returncode == 0:
print("Command output:")
print(cmd3.stdout)
else:
# Print the error message
print("Error executing command:")
print(cmd3.stderr)
sleep(5)
cmd4 = subprocess.run("apt-get install -y chromium", shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True)
if cmd4.returncode == 0:
print("Command output:")
print(cmd4.stdout)
else:
# Print the error message
print("Error executing command:")
print(cmd4.stderr)
sleep(5)
cmd5 = subprocess.run("apt-get install -y libfontconfig1 libnss3", shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True)
if cmd5.returncode == 0:
print("Command output:")
print(cmd5.stdout)
else:
# Print the error message
print("Error executing command:")
print(cmd5.stderr)
sleep(5)
st.text("done")
st.text("chrome")
driver = webdriver.Chrome()
# def open_website(url):
# driver = webdriver.Chrome() # Initialize Chrome WebDriver
# driver.get(url) # Open the URL in Chrome
# assert "Python" in driver.title
# def main():
# st.title("Website Opener")
# st.write("Click the button below to open a website.")
# website_url = st.text_input("Enter website URL:", "https://google.com")
# if st.button("Open Website"):
# open_website(website_url)
# if __name__ == "__main__":
# main()
|