Skip to content

Instantly share code, notes, and snippets.

@liquidgenius
liquidgenius / submit_assignment.py
Created June 28, 2018 03:32 — forked from WillKoehrsen/submit_assignment.py
Automation of Assignment Submisison
# selenium for web driving
import selenium
from selenium import webdriver
# time for pausing between navigation
import time
# Datetime for recording time of submission
import datetime
@liquidgenius
liquidgenius / fb.py
Created June 28, 2018 03:30 — forked from sushain97/fb.py
Downloads, archives, analyzes and plots Facebook Messenger conversations (individual and group)
#!/usr/bin/env python3
__author__ = 'Sushain K. Cherivirala'
import argparse
import cmd
import collections
import contextlib
import copy
import datetime
@liquidgenius
liquidgenius / gist:5fe68525ea3e24d0ed3c6345f510390a
Created June 28, 2018 03:28 — forked from observerss/gist:3798896
Google Keyword Tool Scraper(selenium+python version)
# EDIT: 2013/10/20
# google has updated its kwt UI, this script doesn't work any more!
# may be I will update this script when I have time to investigate their new Interface.
from selenium import webdriver
from selenium.common.exceptions import TimeoutException
import selenium.webdriver.support.wait
selenium.webdriver.support.wait.POLL_FREQUENCY = 0.05
import re
@liquidgenius
liquidgenius / requests.py
Last active June 28, 2018 03:27 — forked from stevenrich-zz/278requests.py
Automating requests
import csv, time
from selenium import webdriver
from selenium.webdriver.support.ui import Select
from selenium.webdriver.common.keys import Keys
applicant_name = # your name
applicant_email = # your email
applicant_address = # your physical address
occupation = # your occupation
@liquidgenius
liquidgenius / qqmessage.py
Created June 28, 2018 03:24 — forked from xiaostrong/qqmessage.py
QQ空间留言脚本
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
import requests
import time
import re
import json
import time
def login():
options = webdriver.ChromeOptions()
@liquidgenius
liquidgenius / chrome_headless_screenshot.py
Created June 28, 2018 03:23 — forked from rverton/chrome_headless_screenshot.py
Make a screenshot with a headless google chrome in python
# Install chromedriver from https://sites.google.com/a/chromium.org/chromedriver/downloads
import os
from optparse import OptionParser
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
CHROME_PATH = '/usr/bin/google-chrome'
@liquidgenius
liquidgenius / chromemobiletest.py
Created June 28, 2018 03:22 — forked from devinmancuso/chromemobiletest.py
Example Python Chrome Mobile Emulation Automated Unit Testing Using Selenium 2 WebDriver ChromeDriver
# Import unittest module for creating unit tests
import unittest
# Import time module to implement
import time
# Import the Selenium 2 module (aka "webdriver")
from selenium import webdriver
# For automating data input
@liquidgenius
liquidgenius / install.sh
Created June 28, 2018 03:19 — forked from ziadoz/install.sh
Install Chrome, ChromeDriver and Selenium on Ubuntu 16.04
#!/usr/bin/env bash
# https://developers.supportbee.com/blog/setting-up-cucumber-to-run-with-Chrome-on-Linux/
# https://gist.github.com/curtismcmullan/7be1a8c1c841a9d8db2c
# http://stackoverflow.com/questions/10792403/how-do-i-get-chrome-working-with-selenium-using-php-webdriver
# http://stackoverflow.com/questions/26133486/how-to-specify-binary-path-for-remote-chromedriver-in-codeception
# http://stackoverflow.com/questions/40262682/how-to-run-selenium-3-x-with-chrome-driver-through-terminal
# http://askubuntu.com/questions/760085/how-do-you-install-google-chrome-on-ubuntu-16-04
# Versions
CHROME_DRIVER_VERSION=`curl -sS chromedriver.storage.googleapis.com/LATEST_RELEASE`

API workthough

  1. Open a browser

    # start an instance of firefox with selenium-webdriver
    driver = Selenium::WebDriver.for :firefox
    # :chrome -> chrome
    # :ie     -> iexplore
    
  • Go to a specified URL
@liquidgenius
liquidgenius / kanview_complete.py
Created June 28, 2018 03:16 — forked from gitdagray/kanview_complete.py
Full Python code for web scraping Kanview utilizing Selenium, Beautiful Soup, and pandas
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from bs4 import BeautifulSoup
import re
import pandas as pd
from tabulate import tabulate
import os
#launch url
url = "http://kanview.ks.gov/PayRates/PayRates_Agency.aspx"