Selenium-Script / app.py
Container's picture
Update app.py
baa68d1 verified
raw
history blame
626 Bytes
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from fastapi import FastAPI, Request
import uvicorn
app = FastAPI()
@app.get("/")
def main():
options = Options()
options.add_argument('--headless')
driver = webdriver.Chrome(options=options)
driver.get('https://test5.container-z.art/test26')
cookies = driver.get_cookies()
print(cookies)
current_url = driver.current_url
print(current_url)
driver.quit()
return {"code": 200,"msg":"Success"}
if __name__ == '__main__':
uvicorn.run(app='app:app', host="0.0.0.0", port=7860)