forked from umihico/docker-selenium-lambda
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.py
More file actions
16 lines (14 loc) · 627 Bytes
/
test.py
File metadata and controls
16 lines (14 loc) · 627 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
from selenium import webdriver
def handler(event=None, context=None):
options = webdriver.ChromeOptions()
options.binary_location = "/opt/headless-chromium"
options.add_argument('--headless')
options.add_argument('--no-sandbox')
options.add_argument("--disable-gpu")
options.add_argument("--window-size=1280x1696")
options.add_argument("--single-process")
options.add_argument("--disable-dev-shm-usage")
chrome = webdriver.Chrome("/opt/chromedriver",
options=options)
chrome.get("https://umihi.co/")
return chrome.find_element_by_xpath("//html").text