Questions tagged [headless-browser]

A headless browser is a web browser without a graphical user interface. They are used to provide content of web pages to other programs.

A headless browser is a browser without a GUI. In most cases, it can be accessed from a command line.

They are typically used for automated testing of websites.

Examples include:

682 questions
73
votes
12 answers

Does Selenium support headless browser testing?

I'm looking at Selenium Server at the moment, and I don't seem to notice a driver that supports headless browser testing. Unless I'm mistaken, it doesn't support it. If you're on X, you can create a virtual framebuffer to hide the browser window,…
70
votes
14 answers

headless internet browser?

I would like to do the following. Log into a website, click a couple of specific links, then click a download link. I'd like to run this as either a scheduled task on windows or cron job on Linux. I'm not picky about the language I use, but I'd like…
Jared
  • 38,105
  • 29
  • 104
  • 142
56
votes
6 answers

Headless Browser for Python (Javascript support REQUIRED!)

I need a headless browser which is fairly easy to use (I am still fairly new to Python and programming in general) which will allow me to navigate to a page, log into a form that requires Javascript, and then scrape the resulting web page by…
Steven Matthews
  • 8,255
  • 33
  • 98
  • 186
56
votes
5 answers

Detect Chrome running in headless mode from JavaScript

With the release of Chrome 59, "headless" mode is now available in stable builds for Linux and macOS (and soon also Windows with Chrome 60). This allows us to run a full-featured version of Chrome without any visible UI, a great capability to have…
Jeremy
  • 1
  • 77
  • 324
  • 346
55
votes
6 answers

How do I use Headless Chrome in Chrome 60 on Windows 10?

I've been looking at the following article about Headless Chrome: https://developers.google.com/web/updates/2017/04/headless-chrome I just upgraded Chrome on Windows 10 to version 60, but when I run either of the following commands from the command…
52
votes
13 answers

Why doesn't Node.js have a native DOM?

When I discovered that Node.js was built using the V8 JavaScript engine, I thought: Great, web scraping will be easier as the page will be rendered like in the browser, with a "native" DOM supporting XPath and any AJAX calls on the…
PeterB
  • 1,612
  • 1
  • 15
  • 29
50
votes
7 answers

save html output of page after execution of the page's javascript

There is a site I am trying to scrape, that first loads an html/js modifies the form input fields using js and then POSTs. How can I get the final html output of the POSTed page? I tried to do this with phantomjs, but it seems to only have an option…
gyaani_guy
  • 3,035
  • 7
  • 39
  • 48
45
votes
6 answers

Headless, scriptable Firefox/Webkit on linux?

I'm looking to automate some web interactions, namely periodic download of files from a secure website. This basically involves entering my username/password and navigating to the appropriate URL. I tried simple scripting in Python, followed by more…
Parand
  • 91,328
  • 43
  • 147
  • 182
41
votes
3 answers

How can I set the browser window size when using `google-chrome --headless`?

I tried setting the browser size on Chrome --headless by using Selenium WebDriver commands. I get this WebDriver error: - Failed: unknown error: cannot get automation extension from unknown error: page could not be found:…
Leo Gallucci
  • 15,165
  • 11
  • 66
  • 103
35
votes
9 answers

How to delete existing text from input using Puppeteer?

I'm trying to test amending text in an editable input which contains the title of the current record - and I want to able to test editing such text, replacing it with something else. I know I can use await page.type('#inputID', 'blah'); to insert…
34
votes
1 answer

Make Chrome Headless to Wait for Ajax Before Printing to PDF

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…
Gil Shamgar
  • 468
  • 1
  • 5
  • 10
31
votes
6 answers

Headless node.js javascript browser with screenshot capability?

Are there any headless browsers for node.js that support dumping a rendered page out to a file? I know phantomjs supports rendering to a file, but it doesn't run on node.js. I know zombie.js is a node.js headless browser, but it doesn't support…
ryeguy
  • 60,742
  • 51
  • 186
  • 256
31
votes
4 answers

Collect elements by class name and then click each one - Puppeteer

Using Puppeteer, I would like to get all the elements on a page with a particular class name and then loop through and click each one. Using jQuery, I can achieve this with: var elements = $("a.showGoals").toArray(); for (i = 0; i <…
Richlewis
  • 13,978
  • 32
  • 103
  • 238
30
votes
6 answers

Headless browser with full javascript support for java

I have been using HtmlUnit (the developers did a great job) as an headless browser for some of my previous applications but the javascript support isn't working for some website that my next application will be accessing. I heard about QtWebKit…
John
  • 1,641
  • 5
  • 20
  • 29
21
votes
0 answers

Is it possible to install Headless Chrome without X11 dependencies?

I wonder if is it possible to somehow install Headless Chrome without X11 dependencies, e.g. on a VM or in a Docker container? Currently when I install it from the Chrome repo it downloads lots of useless stuff as dependencies. It takes a long time…
knuhol
  • 3,636
  • 4
  • 27
  • 53
1
2 3
45 46