• python实现网页截图


    https://www.cnblogs.com/Mongol-J/p/12712492.html

    https://npm.taobao.org/mirrors/chromedriver

    1、pip install selenium

    2、pip install chromedriver

    3、下载chromedriver,确认好本机chrome对应的版本

    http://chromedriver.storage.googleapis.com/index.html

    4、代码如下:

     1 import os
     2 import shutil
     3 from selenium import webdriver
     4 import time
     5 import random
     6 
     7 try:
     8     driver = webdriver.Chrome(r"D:\Download\chromedriver.exe")
     9     picture_url = "https://www.baidu.com"
    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 except BaseException as msg:
    22     print(msg)

    Linux截图:

    按照linux chrome
    wget https://dl.google.com/linux/direct/google-chrome-stable_current_x86_64.rpm
    yum install ./google-chrome-stable_current_x86_64.rpm


    chmod +x chromedriver

    移动端代码
    https://blog.csdn.net/lylfv/article/details/106901541

    pc端代码
    https://blog.csdn.net/u012887259/article/details/103306861

    截长图:

    https://www.cnblogs.com/feibazhf/p/14337452.html

  • 相关阅读:
    通过mixins方法处理调取服务器时间
    记录个人对vuex的简单理解
    利用弹性布局实现垂直居中
    vue.set的适用方法
    深拷贝和浅拷贝的实现方法
    Maven安装步骤
    build tools
    Git
    Url和Uri的区别
    函数式编程语言
  • 原文地址:https://www.cnblogs.com/wsongl/p/14437098.html
Copyright © 2020-2023  润新知