File tree Expand file tree Collapse file tree 1 file changed +2
-5
lines changed Expand file tree Collapse file tree 1 file changed +2
-5
lines changed Original file line number Diff line number Diff line change 55
66def handler (event = None , context = None ):
77 options = webdriver .ChromeOptions ()
8- service = webdriver .ChromeService ("/opt/chromedriver" )
9-
108 options .binary_location = '/opt/chrome/chrome'
119 options .add_argument ('--headless' )
1210 options .add_argument ('--no-sandbox' )
@@ -20,8 +18,7 @@ def handler(event=None, context=None):
2018 options .add_argument (f"--data-path={ mkdtemp ()} " )
2119 options .add_argument (f"--disk-cache-dir={ mkdtemp ()} " )
2220 options .add_argument ("--remote-debugging-port=9222" )
23-
24- chrome = webdriver . Chrome ( options = options , service = service )
21+ chrome = webdriver . Chrome ( "/opt/chromedriver" ,
22+ options = options )
2523 chrome .get ("https://example.com/" )
26-
2724 return chrome .find_element (by = By .XPATH , value = "//html" ).text
You can’t perform that action at this time.
0 commit comments