headless-browser

How to hide SWT Browser or run in headless mode?

核能气质少年 提交于 2019-12-25 05:14:40
问题 I took the rendered page from the SWT Browser and exported it to an image. My problem is that I am not able to get it to export properly when the shell is not visible. How can I go about hiding the browser and have the image export properly? I have tried setting shell.Visible() to false but that messes up the image export. This is how I export the image (not sure if this is necessary to the question): GC source = new GC (shell); Image image = new Image(display, browser.getClientArea());

Selenium scraping: changing timezone

隐身守侯 提交于 2019-12-24 01:04:38
问题 The website I run my headless (PhantomJS) browser through Selenium has different timezone so I get the wrong dates for many entries. Thus my scraped results show the wrong dates/times (i'm in EST, looks like website default is GMT). I'm scraping from this website. You can get an idea of how i'm scraping dates through a previous question on SO here. Note however i'm not currently scraping the times of games so i'd prefer not to incorporate this in a solution. The same question is asked here

PhantomJS version compatibility with Selenium

我只是一个虾纸丫 提交于 2019-12-23 17:41:09
问题 I could not use Selenium WebDriver (a.k.a Selenium 2) 2.53.0 with PhantomJS 1.2.0. Is there any workaround? I had to use WebDriver 2.41.0 instead of latest version (2.53.0). 回答1: phantomjsdriver-1.2.1.jar is provided with Selenium-2.53.0. If phantomjsdriver-1.2.0 is not worked with Selenium-2.53.0 you can use phantomjsdriver-1.2.1 . Dependency code for the pom.xml should be as below: <dependency> <groupId>org.seleniumhq.selenium</groupId> <artifactId>selenium-java</artifactId> <version>2.53.0

PhantomJS, but not headless?

北慕城南 提交于 2019-12-23 07:39:04
问题 Is there a way to get a realtime view of what PhantomJS (or similar) is rendering? I would like to develop my automation script while interacting with (or at least seeing a screencap of) the page it's targeted to. 回答1: No, there is no such thing. SlimerJS has the same API as PhantomJS, but runs the Gecko engine. You can see directly what is going on and run it headlessly with xvfb-run. You will not be able to interact with it. You may want to use a screengrabber to record a video of the

In Jenkins haedless browser :org.openqa.selenium.WebDriverException: Error communicating with the remote browser. It may have died

五迷三道 提交于 2019-12-23 05:49:16
问题 Hi I am executing scripts on Jenkins headless browser using Selenium web driver and Java. After two or three scripts run I am getting below error this problem I observer when I will run multiple scripts at one run but when I executed single script it will not through any error. Please help me out to solve this problem. Below is the error code. org.openqa.selenium.WebDriverException: Error communicating with the remote browser. It may have died. Build info: version: '2.51.0', revision:

is possible run selenium with headless browser to handle functionalities?

左心房为你撑大大i 提交于 2019-12-23 05:25:11
问题 My objective is running automation based selenium webdriver from Jenkins, but jenkins cannot open browser when build job. so I modified my code to run in headless mode. since implementing headless browser, having some big question is possible to handle end to end business on headless browser? cause end to end need inspect element as the process if headless browser cannot handle, do you have some suggestion? thanks, I'm very low to integrate automation 回答1: You don't have to change the code to

Headless Firefox in Selenium C#

家住魔仙堡 提交于 2019-12-21 09:17:39
问题 I want to run firefox headless. Not hide the browser window or open it in a virtual desktop, Firefox supports headless mode by using "-headless" flag. Problem is I know how to do it in chrome but not in Firefox. My code: using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; using OpenQA.Selenium; using OpenQA.Selenium.Firefox;

Why can't I access 'window' in an exposeFunction() function with Puppeteer?

▼魔方 西西 提交于 2019-12-21 04:34:10
问题 I have a very simple Puppeteer script that uses exposeFunction() to run something inside headless Chrome. (async function(){ var log = console.log.bind(console), puppeteer = require('puppeteer'); const browser = await puppeteer.launch(); const page = await browser.newPage(); var functionToInject = function(){ return window.navigator.appName; } await page.exposeFunction('functionToInject', functionToInject); var data = await page.evaluate(async function(){ console.log('woo I run inside a

chrome in --headless mode: Provide credentials/auth for proxy

喜夏-厌秋 提交于 2019-12-21 03:37:27
问题 I am running chrome the following way: google-chrome --headless --disable-gpu --dump-dom --disable-web-security Due to a corporate proxy, it seems to be bumping into a authentication popup that is asking to input credentials. How do I inject these credentials on the command line? 回答1: They is no direct way to do this. Google don't allow connection to a proxy with login/password in headless mode. But, I was able to use proxy with credidential by using a MITMProxy. Other technology like Squid

Make Chrome Headless to Wait for Ajax Before Printing to PDF

*爱你&永不变心* 提交于 2019-12-20 17:05:57
问题 I'm trying to use chrome headless to print my webpage to a PDF file. The PDf file is with no data, because the headless chrome is printing it before the ajax commands finish. Any idea on how I can get it to wait? Here's the command I currently use: chrome --headless http://localhost:8080/banana/key --run-all-compositor-stages-before-draw --print-to-pdf=C:\\tmp\\tmp.pdf 回答1: chrome --headless http://localhost:8080/banana/key --run-all-compositor-stages-before-draw --print-to-pdf=C:\tmp\tmp.pdf