苗火 Nicholas
[python]An example of get web page by selenium
2021-8-17 萧
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.action_chains import ActionChains
from selenium.webdriver.common.keys import Keys

chrome_options = webdriver.ChromeOptions()
chrome_options.add_argument('--headless')
chrome_options.add_argument('--disable-gpu')

browser = webdriver.Chrome(chrome_options=chrome_options)
mainUrl = "http://log.anycle.com"
browser.get(mainUrl)
print(f"browser text = {browser.page_source}")
browser.quit()
发表评论:
昵称

邮件地址 (选填)

个人主页 (选填)

内容