Python使用Phantomjs截屏网

发布时间:2019-09-23 17:07:32编辑:auto阅读(1790)

    #!/usr/bin/python
    # -*- coding:utf8 -*-
    
    
    from selenium import webdriver
    import os
    driver1 = webdriver.PhantomJS(executable_path='/usr/local/bin/phantomjs')
    driver1.get("http://www.csdn.net")
    data = driver1.title
    driver1.save_screenshot('csdn.png')
    print data
    print os.getcwd()
    

关键字