google-chrome-headless

ERROR:gpu_process_transport_factory.cc(1007)-Lost UI shared context : while initializing Chrome browser through ChromeDriver in Headless mode

你说的曾经没有我的故事 提交于 2019-12-28 04:20:12
问题 I am getting this error when I attempt to run code on 2 of 3 computers: [0502/155335.565:ERROR:gpu_process_transport_factory.cc(1007)] Lost UI shared context. Here is the code: from selenium import webdriver from selenium.webdriver.chrome.options import Options import os chrome_options = Options() chrome_options.add_argument("--headless") chrome_options.add_argument("--disable-gpu") chrome_options.add_argument("--window-size=1920x1080") chrome_driver = os.getcwd() + "\\chromedriver.exe" print

karma configuration to disable headless chrome and use only terminal

徘徊边缘 提交于 2019-12-25 01:39:27
问题 I am trying to run Angular unit test. I want to configure karma.config file not to open headless chrome. Simply I want to see output in terminal alone. I tried by commenting below code lines in karma.config .... reporters: ['progress', 'kjhtml'], port: 9876, colors: true, logLevel: config.LOG_INFO, autoWatch: true, browsers: ['Chrome'], singleRun: false reporters: ['progress', 'kjhtml'], port: 9876, colors: true, logLevel: config.LOG_INFO, autoWatch: true, browsers: ['Chrome'], singleRun:

Why ProxyServer not working on chromedp GO

元气小坏坏 提交于 2019-12-25 00:52:22
问题 I want to use proxy on chromedp, but proxy not seems to be working, tried chromedp.ProxyServer ctx, cancel := chromedp.NewContext(context.Background()) defer cancel() chromedp.ProxyServer("http://username:password@proxyserver.com:31280") chromedp.Run(ctx, chromedp.Navigate("http://wtfismyip.com"), chromedp.Sleep(3*time.Second), chromedp.ActionFunc(func(ctxt context.Context) error { _, _, contentRect, err := page.GetLayoutMetrics().Do(ctxt) v := page.Viewport{ X: contentRect.X, Y: contentRect

How to wait for event triggered page reloads with Puppeteer?

杀马特。学长 韩版系。学妹 提交于 2019-12-24 18:57:37
问题 I'm trying safely handle the behavior of a page which uses an in-browser event on a select element to trigger a page reload (POST). The URL is the same but the page reloads with the same HTML and the only difference is the sort order of content in a table. I tried several methods but somehow none are reliable, how can I achieve something like this: try { await page.select('select[name=sort]', 'size'); await page.waitForNextPageReload(); await page.waitForSelector('select[name=sort]'); } catch

Headless chrome not working as advertised

回眸只為那壹抹淺笑 提交于 2019-12-24 00:23:03
问题 Having used this page as a reference: http://executeautomation.com/blog/running-chrome-in-headless-mode-with-selenium-c/ I have tried to get Chrome working in headless mode (with a view to running under SpecFlow/xUnit). This has failed spectacularly and I would like to know if anyone has a solution/fix. I'm running VS 2015 on Windows 7 with a .NET 4.7 console application and Google Chrome Version 65.0.3325.162 (Official Build) (64-bit)... Here's my packages.config: <?xml version="1.0"

Puppeteer custom header footer for PDF render

拜拜、爱过 提交于 2019-12-24 00:21:11
问题 I am working on rendering a PDF of a site. I want different headers and footers for the first page and different for the rest of the pages. Is there any way to do this? const puppeteer = require('puppeteer'); (async() => { var t = Date.now(); console.log('Current time ' + t + ' msec'); const browser = await puppeteer.launch({executablePath: 'C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe', ignoreHTTPSErrors:true, headless:true, devtools:false}); const page = await browser

running headless chrome in an microsoft azure web app

荒凉一梦 提交于 2019-12-23 23:10:43
问题 I am currently using phantomjs to generate screenshots of web pages. Due to various issues including web fonts, and video tag support, I would like to try switching to headless chrome. Has anyone had success running headless chrome in an azure web app? I cannot find a .net api, and assume I need to run node.js with puppeteer If I want a javascript api similar to phantomjs. 回答1: Right now most of the big libraries are made for NodeJS. It's possible to run Chrome headless without it, but you'll

Selenium with chromedriver gives different results based on “headless” argument

怎甘沉沦 提交于 2019-12-22 12:24:39
问题 I have been playing around with Selenium + Chromedriver and I noticed I get different results based on if headless is enabled or disabled. After some investigation I found out that "headless" does not include the Accept-Language header. Is there anyway to manually add this in the headers? 回答1: That's what Google chrome does. One way around it would be to use a proxy and modify the headers for you. Or you can use the Firefox driver as that driver does not send different headers when using the

Selenium with chromedriver gives different results based on “headless” argument

强颜欢笑 提交于 2019-12-22 12:24:07
问题 I have been playing around with Selenium + Chromedriver and I noticed I get different results based on if headless is enabled or disabled. After some investigation I found out that "headless" does not include the Accept-Language header. Is there anyway to manually add this in the headers? 回答1: That's what Google chrome does. One way around it would be to use a proxy and modify the headers for you. Or you can use the Firefox driver as that driver does not send different headers when using the

Headless chrome with python suspends when trying to download a file

℡╲_俬逩灬. 提交于 2019-12-22 04:33:54
问题 I'm using Python, Jupyter, Selenium webdriver and headless chrome (with Canary) on Mac. I wrote a script that scrapes a very old website, In order to download a file from that website I need to click on several buttons which eventually lead me to a button that once clicked it downloads a CSV file The problem is that when headless chrome tries to download the target file it suspends and does nothing (i.e. doesn't download the required file) even though the script finished running (and yes I