Getting the (rendered) source in headless mode

628 views
Skip to first unread message

Arik

unread,
Dec 22, 2021, 11:35:20 AM12/22/21
to headless-dev
Hi.

  I run something like
chrome --headless --disable-gpu --enable-logging --dump-dom https://my.url/

  I get an html file, which is supposed to contain the source code the browser will be working on. However, when I open a chrome window, visit that site and view the source code, I see something different. Maybe some Javascript is changing things - but that's supposed to be taken care by the headless mode (indeed, if I fetch the file using curl or something like that, I get a yet different file. Evidently the headless chrome executes the JS, but maybe not all of it. Or may it be something other than JS that's changing things?)

  How can I convince the headless chrome to give me the real (final) version that the user of the windowed chrome will see?

Александр Рич

unread,
Oct 2, 2022, 5:56:55 AM10/2/22
to headless-dev, Arik

Hello.
I've the same issue.
Has you found the answer?
среда, 22 декабря 2021 г. в 18:35:20 UTC+2, Arik:

Oscar Camacho

unread,
Nov 7, 2022, 9:18:34 AM11/7/22
to headless-dev, Александр Рич, Arik
Hi, guys.

I'm facing the same issue, I tried to set the virtual-time-budget property to wait until the page be completed, but I got the same result.

any idea ?

Regards.

Alexander S.

unread,
Sep 24, 2023, 2:55:12 PM9/24/23
to headless-dev, Oscar Camacho, Александр Рич, Arik
Hi,

Is there any way of getting the raw HTML page source received from the server? Not the once after running the scripts on the page.

Best,
Alex

Andrey Kosyakov

unread,
Sep 27, 2023, 6:04:49 PM9/27/23
to Alexander S., headless-dev, Oscar Camacho, Александр Рич, Arik
Hi Alexander,

On Sun, Sep 24, 2023 at 11:55 AM 'Alexander S.' via headless-dev <headle...@chromium.org> wrote:
Hi,

Is there any way of getting the raw HTML page source received from the server? Not the once after running the scripts on the page.

We recommend using Puppeteer for things like that, e.g. Page.waitForResponse() or Page.setRequestInterception() should get you there.
We don't support any non-trivial use cases with bare command line interface -- it's only retained for compatibility at this point and will not see additional features added.

Best regards,
Andrey.

Jerry Lee Daniel

unread,
Nov 19, 2023, 10:58:54 AM11/19/23
to headless-dev, Andrey Kosyakov, headless-dev, Oscar Camacho, Александр Рич, Arik, Alexander S.
Loans, Project and Digital Investment financing available up to $500m.
Have a Business Plan, Fundable Project and Redeemable Collateral.

Whatsapp: +44 7405 896213
Reply all
Reply to author
Forward
0 new messages