Skip to content

Instantly share code, notes, and snippets.

View germainlefebvre4's full-sized avatar

Germain Lefebvre germainlefebvre4

View GitHub Profile
@germainlefebvre4
germainlefebvre4 / parse_auchan-products
Created September 29, 2018 22:36
Selenium Python - Parse Auchan Products with configurable sotres and products
#!/usr/bin/python3
import re
from selenium import webdriver
list_stores = [
"https://www.auchandrive.fr/drive/mag/update-924",
]
list_products = [
"https://www.auchandrive.fr/catalog/coca-cola-zero-1l-P762493",
@germainlefebvre4
germainlefebvre4 / selenium_first-step.sh
Last active September 30, 2018 19:07
Selenium Python - First-Step - Centos 7 dependencies
# Centos 7
yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
yum-config-manager --enable epel
yum install -y vim wget unzip git python34 python34-pip # python34-devel
mkdir /opt/chromedriver
wget https://chromedriver.storage.googleapis.com/2.42/chromedriver_linux64.zip
unzip chromedriver_linux64.zip -d /opt/chromedriver
rm -f chromedriver_linux64.zip
mv /opt/chromedriver/chromedriver /opt/chromedriver/chromedriver-2.42
@germainlefebvre4
germainlefebvre4 / selenium_first-step.py
Last active September 29, 2018 14:53
Selenium Python - First-Step : Very simple example
#!/usr/bin/python2
from selenium import webdriver
chrome_options = webdriver.ChromeOptions()
chrome_options.add_argument('--headless')
chrome_options.add_argument('--no-sandbox')
driver = webdriver.Chrome('chromedriver', chrome_options=chrome_options, service_args=['--verbose', '--log-path=/tmp/chromedriver.log'])
driver.get('https://python.org')
@germainlefebvre4
germainlefebvre4 / Wordpress_Shortcode_Lister_Brouillons
Last active August 29, 2015 14:04
Wordpress : Créer un shortcode pour lister les articles en brouillon
------------------------------------------------------------
Wordpress
------------------------------------------------------------
Créer un [Shortcode] pour lister les articles en brouillon
------------------------------------------------------------
<?php
function shortcode_brouillons($param) {
@germainlefebvre4
germainlefebvre4 / Linux Static IP
Created June 29, 2014 13:42
Comment configurer une adresse IP statique sur CentOS 6
## Configure eth0
#
# vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE="eth0"
NM_CONTROLLED="yes"
ONBOOT=yes
HWADDR=A4:BA:DB:37:F1:04
TYPE=Ethernet
BOOTPROTO=static