コード例 #1
0
### Set data storage variables
root_folder = "../"
homepages_dir = root_folder + "html_src/" + pubshort + "/"
screenshots_dir = root_folder + "screenshots/" + pubshort + "/"

########### Load libraries
from selenium import webdriver
from datetime import datetime
from pyvirtualdisplay import Display
import scraperfunctions
import argparse, sys

########### Let's check for command-line arguments
parser = argparse.ArgumentParser()
parser = scraperfunctions.add_common_arguments(parser)
### Add additional arguments here.
args = parser.parse_args()
curr_time = args.curr_time
download_desktop = args.download_desktop
download_mobile = args.download_mobile
parse = args.parse
parsefile = args.parsefile

### Grab the information from our configuration file
config = scraperfunctions.load_config()

### Get the current time if we don't already have one (and transform into a date object)
curr_time = scraperfunctions.get_curr_time(curr_time, parsefile)

### Establish our MySQL Connection (for logging, etc.)
コード例 #2
0
ファイル: kcs.py プロジェクト: rodzam/metrics_placement
### Set data storage variables
root_folder = "../"
homepages_dir = root_folder + "html_src/" + pubshort + "/"
screenshots_dir = root_folder + "screenshots/" + pubshort + "/"

########### Load libraries
from selenium import webdriver
from datetime import datetime
from pyvirtualdisplay import Display
import scraperfunctions
import argparse, sys

########### Let's check for command-line arguments
parser = argparse.ArgumentParser()
parser = scraperfunctions.add_common_arguments(parser)
### Add additional arguments here.
args = parser.parse_args()
curr_time = args.curr_time
download_desktop = args.download_desktop
download_mobile = args.download_mobile
parse = args.parse
parsefile = args.parsefile

### Grab the information from our configuration file
config = scraperfunctions.load_config()

### Get the current time if we don't already have one (and transform into a date object)
curr_time = scraperfunctions.get_curr_time(curr_time, parsefile)

### Establish our MySQL Connection (for logging, etc.)