Created
April 26, 2017 13:40
-
-
Save ueokande/71ee36460f7a63ad8fbc90260f55fade to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var page = require('webpage').create(); | |
page.open('http://www.tamagoya.co.jp/menu_list.html', function() { | |
var rect = page.evaluate(function() { | |
var menuDate = Array.prototype.find.call( | |
document.querySelectorAll('.menutitle_date'), | |
(e) => e.textContent.includes("26") ); | |
var menuTitle = menu_date.parentElement; | |
var menuList = menuTitle.nextElementSibling | |
var menuBottom = menuList.nextElementSibling | |
}); | |
// page.viewportSize = { width: rect.width, height: rect.height }; | |
//the clipRect is the portion of the page you are taking a screenshot of | |
page.clipRect = { top: rect.top, left: rect.left, width: rect.width, height: rect.height }; | |
page.render('github.png'); | |
phantom.exit(); | |
}); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment