📜  如何在 selenium python 中获取 html 代码 - Html 代码示例

📅  最后修改于: 2022-03-11 14:52:54.353000             🧑  作者: Mango

代码示例1
#_*_coding: utf-8_*_
from selenium import webdriver
import time
# start web 
browserbrowser=webdriver.Firefox()
# get source 
codebrowser.get("https://en.wikipedia.org")
html = browser.page_source
time.sleep(2)
print(html)
# close web browser
browser.close()