from selenium import webdriver browser = webdriver.Chrome(executable_path='F:/chromedriver/chromedriver_win32/chromedriver.exe') url = 'https://www.baidu.com/' browser.get(url) text = browser.page_source # browser.close() print(text)