Q
Q
Quolib2019-03-17 00:08:15
Java
Quolib, 2019-03-17 00:08:15

How can I get cookies after loading js on a site without a visible browser?

When the site loads, a number of js are executed on it, which causes cookies to appear or be updated. I would like to write a java program that would receive these cookies, but I don't know which libraries to use for this; in general, I understand that you first need to imitate a browser so that all scripts are loaded, and then request cookies, but I don’t know what is better to choose for this task. Ps It is desirable to imitate the browser invisible.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
O
Orkhan, 2019-03-17
@Quolib

Ps It is desirable to imitate the browser invisible.

This is called headless mode.
You can, for example, take selenium + any browser of your choice (firefx, chrome, etc.) and run them in headless mode.
And about receiving cookies using Seleinum - https://www.guru99.com/handling-cookies-selenium-w...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question