webpage-screenshot

Phantomjs works but is very slow

谁说胖子不能爱 提交于 2019-12-02 19:18:42
I am trying to take a screenshot of a webpage with PhantomJS. Specifically, I am using the example of capturing espn.com from this example. My code looks like this: var page = new WebPage(); page.open('http://www.espn.com', function (status) { page.render('fb.png'); phantom.exit(); }); I then go to my PhantomJS directory with either my terminal or command prompt and run: phantomjs shotty.js Everything runs great, however it takes 6-8 seconds to complete the output image. Is that normal? Is there a faster way to accomplish this so that it completes in a second or less? I am using CentOS and

How to take screenshot of a website with Rails 3.1? — without using a service

南楼画角 提交于 2019-12-02 17:18:57
Almost every answer I've found references using some existing service. Is there a way to do this using Rails 3.1 programmatically? This was dead easy to do with PHP (there are prebuilt libraries in PHP that do this). What I'm looking to do, given a URL, is: Take a screenshot of the website Crop it (only take the top left most 100x100 pixels PS. Here is my environment: Rails 3.1 , Ruby 1.9.2 Note: The solution would probably need to follow any redirections on the URL as well. Updates: I've seen https://github.com/topfunky/osxscreenshot The problem is that it requires an older version of Ruby (1

opening URL from a file and taking screenshots in UiPath

一世执手 提交于 2019-12-02 13:53:34
问题 It's a UI path sequence. I am trying to read some URLs from an Excel file. Launch browser Go to URL from file Take Screenshot Save screenshot I am unable to use the "take Screenshot" activity. Unsure, how can I take the screenshot and save it as a file. 回答1: The Take Screenshot activity requires a variable (of type Image ). Select the activity first, and in the properties, click on Output. Then, hit CTRL+K to add a new variable (or enter an existing one). Use the Save Image activity to save

opening URL from a file and taking screenshots in UiPath

拜拜、爱过 提交于 2019-12-02 04:51:06
It's a UI path sequence. I am trying to read some URLs from an Excel file. Launch browser Go to URL from file Take Screenshot Save screenshot I am unable to use the "take Screenshot" activity. Unsure, how can I take the screenshot and save it as a file. The Take Screenshot activity requires a variable (of type Image ). Select the activity first, and in the properties, click on Output. Then, hit CTRL+K to add a new variable (or enter an existing one). Use the Save Image activity to save any variable of type Image to disk. 来源: https://stackoverflow.com/questions/51420426/opening-url-from-a-file

Take screenshot of host app using iOS share/action extensions?

杀马特。学长 韩版系。学妹 提交于 2019-11-30 19:29:00
问题 I will like to know how to take a screenshot of the iOS host app with the use of a share/action extension. My use case is as follows: use the Safari browser to access a webpage (https such as gmail) tap on the Share button and select the extension the extension will take a screenshot of the current webpage An working example for this use case is the Awesome Screenshot iOS app. I had tried the following methods reload the baseURI (loadRequest) on a UIWebView/WKWebkit (would not be able to

how to capture screenshot in html using js or jquery [duplicate]

点点圈 提交于 2019-11-29 09:33:00
问题 This question already has an answer here: Using HTML5/Canvas/JavaScript to take in-browser screenshots 4 answers How to screenshot website in JavaScript client-side / how Google did it? (no need to access HDD) [duplicate] 2 answers I'm need my clients be able to capture screenshot of any page of my website using button like this: <button>Take screenshot</button> I tried to use html2canvas but it's doesn't work properly for me because i have iframe's in my website and it's cause some session

How do I capture a screenshot if my nosetests fail?

江枫思渺然 提交于 2019-11-29 02:26:58
I am running selenium webdriver tests with nosetests. I want to capture a screenshot whenever nosetests fail. How can I do it in the most effective way, either by using webdriver, python or nosetests features? My solution import sys, unittest from datetime import datetime class TestCase(unittest.TestCase): def setUp(self): some_code def test_case(self): blah-blah-blah def tearDown(self): if sys.exc_info()[0]: # Returns the info of exception being handled fail_url = self.driver.current_url print fail_url now = datetime.now().strftime('%Y-%m-%d_%H-%M-%S-%f') self.driver.get_screenshot_as_file('

Take screenshot of full page with Selenium Python with chromedriver

旧城冷巷雨未停 提交于 2019-11-27 07:07:17
After trying out various approaches... I have stumbled upon this page to take full-page screenshot with chromedriver, selenium and python. The original code is here . (and I copy the code in this posting below) It uses PIL and it works great! However, there is one issue... which is it captures fixed headers and repeats for the whole page and also misses some parts of the page during page change. sample url to take a screenshot: http://www.w3schools.com/js/default.asp How to avoid the repeated headers with this code... Or is there any better option which uses python only... ( i don't know java

How to take screen shot of current webpage using Javascript/JQuery?

ぐ巨炮叔叔 提交于 2019-11-27 01:52:54
I was trying to take screen shot of a web page using JavaScript/JQuery. Could you please explain me the code steps I need to follow? Edward The html2canvas2 JavaScript utility is suitable to take a screenshot of a webpage. You have to use three JavaScript libraries: 1.jquery-1.10.2.min.js 2.html2canvas.js 3.jquery.plugin.html2canvas.js Then call the function capture(), which will give you an HTML5 canvas-based screenshot in new window. It also generates a base64data value of image. It only works in browsers that support HTML5 canvas. <script type="text/javascript"> function capture() {

Taking screenshot of a webpage programmatically [closed]

笑着哭i 提交于 2019-11-27 01:37:18
How do take a sceenshot of a webpage programmatically given the URL as input? And here is what I have till now: // The size of the browser window when we want to take the screenshot (and the size of the resulting bitmap) Bitmap bitmap = new Bitmap(1024, 768); Rectangle bitmapRect = new Rectangle(0, 0, 1024, 768); // This is a method of the WebBrowser control, and the most important part webBrowser1.DrawToBitmap(bitmap, bitmapRect); // Generate a thumbnail of the screenshot (optional) System.Drawing.Image origImage = bitmap; System.Drawing.Image origThumbnail = new Bitmap(120, 90, origImage