Skip to content

Instantly share code, notes, and snippets.

View fennecinspace's full-sized avatar
🐧

Mohamed Benkedadra fennecinspace

🐧
View GitHub Profile
@fennecinspace
fennecinspace / .bashrc.virtualenvwrapper
Created May 30, 2018 01:31
Load virtualenvwrapper on demand to speed up your shell
#### in .bashrc.virtualenvwrapper
# Dynamically load virtualenvwrapper functions to reduce shell startup
# time.
#
# Copyright 2012 Aron Griffis <[email protected]>
# Released under the GNU GPL v3
#######################################################################
# Python virtualenvwrapper loads really slowly, so load it on demand.
@fennecinspace
fennecinspace / timeout.py
Created December 31, 2018 00:30
Timeout Thread
import threading
class TimedThread(threading.Thread):
def __init__(self, fct, *args , timeout = 30, timeout_exception = True, **kwargs):
super().__init__(target = fct, args = args, kwargs = kwargs)
self.fct = fct
self.result = None
self.timeout = timeout
self.timeout_exception = timeout_exception
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.chrome.service import Service
from selenium.webdriver.chrome.options import Options
from webdriver_manager.chrome import ChromeDriverManager
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
import pandas as pd
# Set up Chrome options
///////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////
// Triggers Tutorial : https://www.youtube.com/watch?v=MiWfaCNRzsA
// Global variables for colors using RGB format
// GET COLOR CODES FROM https://www.rapidtables.com/web/color/RGB_Color.html
var COLOR_PROCESSED = '#84FFA1'; // Green