Skip to content

Instantly share code, notes, and snippets.

View sillicon's full-sized avatar
🎯
Focusing

sillicon

🎯
Focusing
  • Lyft
  • San Francisco, CA
View GitHub Profile
@sillicon
sillicon / capture.js
Last active November 27, 2020 22:53
Screen Capture a single webElement, not the whole page in JavaScript, Selenium
const webdriver = require('selenium-webdriver'),
By = webdriver.By,
until = webdriver.until;
const fs = require("fs");
function takeScreenshot(driver, webElement, imagePath) { // driver -> webDriver; webElement -> WebElement; imagePath -> physical path to save the image
var base64Data = "";
var location = {};
var bulk = [];
driver.then(_ => {
@sillicon
sillicon / .block
Last active April 12, 2018 11:28
D3 v4 - Y axis label word wrap/ Label centered on the scale / Horizontal bar with different color(data) / Date x axis / Grid lines
license: mit