Skip to content

Instantly share code, notes, and snippets.

View john92paul's full-sized avatar
🌱
Kill them with your success, Bury them with your smile

John Paul john92paul

🌱
Kill them with your success, Bury them with your smile
View GitHub Profile
from selenium import webdriver # import packages
driver_path = "C:/Users/johndoe/chromedriver.exe" # Defines the chrome driver path
driver = webdriver.Chrome(driver_path) # Define the driver
driver.get("https://www.google.com/") # Open url
driver.save_screenshot("screenshot.png") # Save Screenshot
driver.save_screenshot("screenshot.png")
@john92paul
john92paul / selenium_1.py
Created October 12, 2020 12:37
Selenium Basics
from selenium import webdriver # import packages
driver_path = "C:/Users/johndoe/chromedriver.exe" # Defines the chrome driver path
driver = webdriver.Chrome(driver_path) # Define the driver
driver.get("https://www.google.com/")
<!-- HTML -->
<html>
<body>
<div>
<input type="file" id="imageInput" accept = "image/*">
<canvas id= "myCanvas" width="1000" height="700"></canvas>
</div>
</body>
</html>
<script>
reader.onloadend = function (e) {
var myImage = new Image(); // Creates image object
myImage.src = e.target.result; // Assigns converted image to image object
myImage.onload = function(ev) {
var myCanvas = document.getElementById("myCanvas"); // Creates a canvas object
var myContext = myCanvas.getContext("2d"); // Creates a contect object
myCanvas.width = myImage.width; // Assigns image's width to canvas
myCanvas.height = myImage.height; // Assigns image's height to canvas
myContext.drawImage(myImage,0,0); // Draws the image on canvas
<!DOCTYPE html>
<html lang="en">
<head>
<!-- General -->
<meta charset="utf-8" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Demo | Responsive Landing Page UI Design for Fashion Store</title>
<meta name="viewport" content="width=device-width,minimum-scale=1,initial-scale=1">
<!-- Loading Necessary Fonts -->
<!DOCTYPE html>
<html lang="en">
<head>
<!-- General -->
<meta charset="utf-8" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Demo | Responsive Landing Page UI Design for Interior Design Firm</title>
<meta name="viewport" content="width=device-width,minimum-scale=1,initial-scale=1">
<!-- Loading Necessary Fonts -->
<!DOCTYPE html>
<html lang="en">
<head>
<!-- General -->
<meta charset="utf-8" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Responsive Website UI Design for a aqua fish page</title>
<meta name="viewport" content="width=device-width,minimum-scale=1,initial-scale=1">
<!-- Loading Necessary Fonts -->
<!DOCTYPE html>
<html lang="en">
<head>
<!-- General -->
<meta charset="utf-8" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Responsive Landing Page UI Design for a Nutrition Page</title>
<meta name="viewport" content="width=device-width,minimum-scale=1,initial-scale=1">
<!-- Loading Necessary Fonts -->
/* Button css */
#button-15 .knobs:before, #button-15 .knobs:after{position: absolute;top: 4px;width: 20px;height: 10px;color: #fff;font-size: 10px;font-weight: bold;text-align: center;line-height: 1;padding: 9px 4px;opacity: 1;border-radius: 50%;transform: scale(1);transition: 0.3s cubic-bezier(0.18, 0.89, 0.35, 1.15) all;}
#button-15 .knobs:before{content: '';left: 4px;background-color: #fff;box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.35), 0 10px 10px -5px rgba(0, 0, 0, 0.20);}
#button-15 .knobs:after{content: '';right: 4px;opacity: 0;transform: scale(4);background-color: #fff;}
#button-15 .checkbox:checked + .knobs:before{opacity: 0;transform: scale(4);}
#button-15 .checkbox:checked + .knobs:after{opacity: 1;transform: scale(1);}
#button-15 .checkbox:checked ~ .layer{background-color: #17c2bd;}
.knobs, .layer{position: absolute;top: 0;right: 0;bottom: 0;left: 0;}
.button{position: relative;top: 50%;width: 65px;height: 36px;margin: -20px auto 0 auto;overflow: hidden;margin: 0;}
.button.r, .button.r .layer{