Skip to content

Instantly share code, notes, and snippets.

View ryansmccoy's full-sized avatar
🦖
I may be slow to respond.

ryan ryansmccoy

🦖
I may be slow to respond.
View GitHub Profile
# r'https://pypi.python.org/pypi/selenium
#from bs4 import BeautifulSoup
from selenium import webdriver
import os, time, errno, sys
#import lxml
<!--[if IE 9 ]><html lang="en" class="ie-9 ie"><![endif]--><!--[if IE 10 ]><html lang="en" class="ie-10 ie"><![endif]--><!--[if IE 11 ]><html lang="en" class="ie-11 ie"><![endif]--><!--[if gt IE 9]><!-->
<!DOCTYPE html>
<html class="wf-proximanova-n7-active wf-proximanova-n8-active wf-proximanova-n6-active wf-proximanova-n4-active wf-proximanova-n3-active wf-active" lang="en">
<!--<![endif]-->
<head>
<meta charset="utf-8">
<meta content="ie=edge" http-equiv="x-ua-compatible">
<title>Analysis | ESIOS electricity · data · transparency</title>
<meta content="width=device-width, initial-scale=1" name="viewport">
<link href="/apple-touch-icon-57x57.png" rel="apple-touch-icon" sizes="57x57">
# r'https://pypi.python.org/pypi/selenium
from bs4 import BeautifulSoup
from selenium import webdriver
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
import os, time, errno, sys
import lxml
def main():
if len(sys.argv) < 2:
sys.exit(0)
#!/bin/sh
unset SESSION_MANAGER
unset DBUS_SESSION_BUS_ADDRESS
exec /etc/X11/xinit/xinitrc
gnome-session --session=gnome-classic &
OS=`uname -s`
if [ $OS = 'Linux' ]; then
case "$WINDOWMANAGER" in
*gnome*)
## Supported server options to pass to vncserver upon invocation can be listed
## in this file. See the following manpages for more: vncserver(1) Xvnc(1).
## Several common ones are shown below. Uncomment and modify to your liking.
##
# securitytypes=vncauth,tlsvnc
# desktop=sandbox
# geometry=2000x1200
# localhost
# alwaysshared
[Desktop Entry]
Name=Xsession
Exec=/etc/X11/Xsession
@ryansmccoy
ryansmccoy / pandas_concat_example_simple.py
Created December 22, 2016 22:33
Pandas Concat Folder of CSV Files
import glob
toglob = r'B:\TOMERGE'
files = glob.glob(toglob+'\*')
import pandas as pd
frame = pd.DataFrame()
list_ = []
for file_ in files:
df = pd.read_csv(file_,index_col=None, header=0,encoding='utf-8', low_memory=False, error_bad_lines=False )
@ryansmccoy
ryansmccoy / mongo_import_files_to_db.py
Created December 24, 2016 03:41
import file or files (csv,xlsx) to mongo database
import sys, os
import pandas as pd
import pymongo
import json
import glob
from pymongo import MongoClient
fullpath_of_file = r'B:\all.csv.xlsx'
#files = glob.glob(r'B:\folderoffiles*')
import pandas as pd
import csv
import pyodbc # http://mkleehammer.github.io/pyodbc/
import sys, os
USERNAME = 'sa'
PASSWORD = 'password'
SERVER = 'server'
DATABASE = 'DATA'
@ryansmccoy
ryansmccoy / redis_export_items_url_html_find_career.py
Last active December 28, 2016 01:00
searching homepages for career urls
import os, sys
from bs4 import BeautifulSoup
import lxml
from pyquery import PyQuery as pq
import tldextract
import html5lib
import redis
r = redis.StrictRedis(