screenshot.py
def make_screenshot(keyword_data, chrome_args, size, engines):
    """make screenshots for a set of input keywords"""
    # get keywords
    keywords = get_keywords(keyword_data)
    # create folders to save screenshots in and get path and date
    path, date = create_file_location(engines)
    # configure Chromedriver options
    chrome_options = Options()
    for argument in chrome_args:
        chrome_options.add_argument(argument)
    if 'MOBILE_EMULATION' in globals():
        chrome_options.add_experimental_option("mobileEmulation", MOBILE_EMULATION)
    driver = webdriver.Chrome(chrome_options=chrome_options)
    driver.set_window_size(size[0], size[1]) # set the window size that you need
    # make screenshots
    for keyword in keywords:
        if 'Google' in engines:
            driver.get('https://www.google.de/search?q='+keyword)
            driver.save_screenshot('{}{}.png'.format(path+'\\'+'Google'+'\\', date.strftime("%Y-%m-%d ")+keyword))
        if 'Bing' in engines:
            driver.get('https://www.bing.com/search?q='+keyword)
            driver.save_screenshot('{}{}.png'.format(path+'\\'+'Bing'+'\\', date.strftime("%Y-%m-%d ")+keyword))
make screenshots for a set of input keywords
make screenshots for a set of input keywords
make screenshots for a set of input keywords
def make_screenshot(keyword_data, chrome_args, size, engines):
    keywords = get_keywords(keyword_data)
    path, date = create_file_location(engines)
    chrome_options = Options()
    for argument in chrome_args:
        chrome_options.add_argument(argument)
    if 'MOBILE_EMULATION' in globals():
        chrome_options.add_experimental_option("mobileEmulation", MOBILE_EMULATION)
    driver = webdriver.Chrome(chrome_options=chrome_options)
    driver.set_window_size(size[0], size[1]) 
    for keyword in keywords:
        if 'Google' in engines:
            driver.get('https://www.google.de/search?q='+keyword)
            driver.save_screenshot('{}{}.png'.format(path+'\\'+'Google'+'\\', date.strftime("%Y-%m-%d ")+keyword))
        if 'Bing' in engines:
            driver.get('https://www.bing.com/search?q='+keyword)
            driver.save_screenshot('{}{}.png'.format(path+'\\'+'Bing'+'\\', date.strftime("%Y-%m-%d ")+keyword))
def make_screenshot ( keyword_data , chrome_args , size , engines ) : keywords = get_keywords ( keyword_data ) path , date = create_file_location ( engines ) chrome_options = Options ( ) for argument in chrome_args : chrome_options . add_argument ( argument ) if 'MOBILE_EMULATION' in globals ( ) : chrome_options . add_experimental_option ( "mobileEmulation" , MOBILE_EMULATION ) driver = webdriver . Chrome ( chrome_options = chrome_options ) driver . set_window_size ( size [ 0 ] , size [ 1 ] ) for keyword in keywords : if 'Google' in engines : driver . get ( 'https://www.google.de/search?q=' + keyword ) driver . save_screenshot ( '{}{}.png' . format ( path + '\\' + 'Google' + '\\' , date . strftime ( "%Y-%m-%d " ) + keyword ) ) if 'Bing' in engines : driver . get ( 'https://www.bing.com/search?q=' + keyword ) driver . save_screenshot ( '{}{}.png' . format ( path + '\\' + 'Bing' + '\\' , date . strftime ( "%Y-%m-%d " ) + keyword ) )
make screenshots for a set of input keywords
make screenshots for a set of input keywords
"""make screenshots for a set of input keywords""" # get keywords # create folders to save screenshots in and get path and date # configure Chromedriver options # set the window size that you need # make screenshots
keyword_data
chrome_args
size
engines