Skip to content

Instantly share code, notes, and snippets.

from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from pyquery import PyQuery as pq
# Set options
options = webdriver.ChromeOptions()
options.add_argument('headless')
@liquidgenius
liquidgenius / linkedin_extract.py
Created June 28, 2018 03:40 — forked from lobstrio/linkedin_extract.py
Scraping Linkedin profiles information through Selenium Python
# python package
import csv
import time
import random
import sys
import os
# selenium package
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
@liquidgenius
liquidgenius / google-map-search.py
Created June 28, 2018 03:41 — forked from mcchae/google-map-search.py
Some python selenium examples
#!/usr/bin/env python
################################################################################
import sys
from time import sleep
from selenium import webdriver
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.by import By
from selenium.common.exceptions import NoSuchElementException
@liquidgenius
liquidgenius / expected_conditions_example.py
Created June 28, 2018 03:43 — forked from easonhan007/expected_conditions_example.py
python selenium expected_conditions examples
#encoding:utf-8
# example of how to use https://github.com/SeleniumHQ/selenium/blob/master/py/selenium/webdriver/support/expected_conditions.py
from selenium import webdriver
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.support.wait import WebDriverWait
from selenium.webdriver.common.by import By
import unittest
@liquidgenius
liquidgenius / scraperbbcpollution.py
Created June 28, 2018 03:44 — forked from northernjamie/scraperbbcpollution.py
Python script for scraping pollution data from bbc / earthsense website
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.keys import Keys
import time
import csv
path_to_chromedriver = '/Users/Jamie/Projects/Propolis_Stuff/chromedriver' # change path as needed
@liquidgenius
liquidgenius / download.py
Created June 28, 2018 03:45 — forked from JunhongXu/download.py
A Python script downloading all ICLR and NIPS papers from openreview.net
from selenium import webdriver
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions as EC
import requests
import os
def download_all_papers(base_url, save_dir, driver_path):
driver = webdriver.Chrome(driver_path)
@liquidgenius
liquidgenius / faking_location.py
Created June 28, 2018 03:48 — forked from sqe/faking_location.py
Faking geolocation in Chrome with javascript for @RubyTester
# Solution found @ http://stackoverflow.com/a/31803008:
from selenium import webdriver
import requests
driver = webdriver.Chrome()
fake_lat = "37.773972"
fake_long = "-122.431297"
from selenium import webdriver
from selenium.webdriver.common.proxy import Proxy
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
import zipfile
@liquidgenius
liquidgenius / easing.py
Created July 8, 2018 06:04 — forked from th0ma5w/easing.py
Easing Equations in Python (orig by Robert Penner)
# ported from http://www.gizma.com/easing/
# by http://th0ma5w.github.io
#
# untested :P
import math
linearTween = lambda t, b, c, d : c*t/d + b
@liquidgenius
liquidgenius / easing.py
Created July 8, 2018 06:09 — forked from cleure/easing.py
Simple easing / tweening example in Python
from math import *
"""
easeInBack: function (x, t, b, c, d, s) {
if (s == undefined) s = 1.70158;
return c*(t/=d)*t*((s+1)*t - s) + b;
},
easeOutBack: function (x, t, b, c, d, s) {