Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // EnvironmentFR represents the french environment variables to set in the browser process EnvironmentFR = []string{ "TZ=Europe/Paris", "LANGUAGE=fr_FR", "LC_ALL=fr_FR.UTF-8", } )
Functions ¶
This section is empty.
Types ¶
type Browser ¶
Browser inherits from *rod.Browser and adds some useful methods
func New ¶
New returns a launched and ready to use browser. It won't use the Leakless side process as it is detected as malware by several AV: this means that without a proper call to Close() the browser won't entirely exit and you will need to kill it yourself. Stealth mode will disable the headless mode and will add stealth mode to the browser and pages created with NewPage() to avoid anti-bot detection.
func (*Browser) ExtractCookiesTo ¶
ExtractCookiesTo extracts all the cookies from the browser and adds them to the jar
func (*Browser) GetHeaders ¶
GetHeaders returns a list of selected headers the browser add to each requests by requesting a mirror request on https://requestmirror.dev. The list is filtered (and modified for some sec-fetch-* headers) to help you make Golang http requests that mimick what a real browser will do with javascript API requests. Don't forget to add your own "accept", "accept-encoding" and "content-type" if necessary. Example: map[
Accept-Language:[fr-FR] Priority:[u=0, i] Sec-Ch-Ua:["Not;A=Brand";v="24", "Chromium";v="128"] Sec-Ch-Ua-Mobile:[?0] Sec-Ch-Ua-Platform:["Windows"] Sec-Fetch-Dest:[empty] Sec-Fetch-Mode:[cors] Sec-Fetch-Site:[same-origin] Upgrade-Insecure-Requests:[1] User-Agent:[Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36]
]
type Page ¶
Page inherits from *rod.Page and adds some useful methods
func (*Page) ExtractCookiesTo ¶
ExtractCookiesTo extracts the cookies from the current page and adds them to the provided jar