/Mongol-J/p/12712492.html
/mirrors/chromedriver
1、pip install selenium
2、pip install chromedriver
3、下载chromedriver,确认好本机chrome对应的版本
http://chromedriver./index.html
4、代码如下:
1 importos2 importshutil3 from selenium importwebdriver4 importtime5 importrandom6
7 try:8 driver = webdriver.Chrome(r"D:\Download\chromedriver.exe")
9 picture_url = ""
10
11 driver.get(picture_url)12 driver.maximize_window()13
14 print(dir(driver))15
16 time.sleep(1)17
18 driver.get_screenshot_as_file('D:\\11.jpg')19 print("%s:截图成功!!!" %picture_url)20 driver.close()21 exceptBaseException as msg:22 print(msg)
Linux截图:
按照linux chrome
wget /linux/direct/google-chrome-stable_current_x86_64.rpm
yum install ./google-chrome-stable_current_x86_64.rpm
chmod +x chromedriver
移动端代码
/lylfv/article/details/106901541
pc端代码
/u012887259/article/details/103306861
截长图:
/feibazhf/p/14337452.html