File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change 14
14
def save_webpage (url , filename ):
15
15
"""Save webpage source to a file."""
16
16
# Create a new instance of the Chrome driver
17
- driver = webdriver .Chrome ()
17
+ options = webdriver .ChromeOptions () # Create a ChromeOptions object
18
+ options .add_argument ("--enable-chrome-browser-cloud-management" )
19
+ options .add_argument ("--log-level=3" ) # This sets the log level to suppress warnings
20
+
21
+
22
+ driver = webdriver .Chrome (options = options )
23
+
24
+
18
25
19
26
try :
20
27
# Open the webpage
21
28
driver .get (url )
22
29
23
30
# Wait for user confirmation
24
- input ("Press Enter when ready to save the webpage..." )
31
+ input ("#" * 50 + " \n Press Enter when ready to save the webpage...\n " )
25
32
time .sleep (WAIT_TIME ) # Let the page load completely
26
33
27
34
# Get the page source
You can’t perform that action at this time.
0 commit comments