#! /usr/local/bin/python3 # coding:utf-8 from selenium import webdriver from time import sleep options = webdriver.ChromeOptions() options.add_argument('--kiosk') driver = webdriver.Chrome(chrome_options=options) driver.get('http://www.baidu.com') a = driver.find_element_by_id("su") a.screenshot("/root/code.png") sleep(5) driver.quit()
去百度注册调取api可准确识别