Supporting:
- Get URL HTML after page finished loading everything + JS
- Passing headers and cookies through JSON payload
- Stealth browser
- Proxy (for headers and cookies) + HTTPS support
Docker image: https://hub.docker.com/r/pedroegg/cloud-selenium
- Run
make run-dockerto run with docker (no other actions needed). - Do POST requests to
http://127.0.0.1:8000/browser/html?url={YOUR_URL}passing theurlquerystring (required) and the fieldstimeout(optional),stealth(optional),headers(optional) andcookies(optional) data through JSON body (sending a body is optional).
Example of JSON body:
{
"timeout": 15,
"stealth": true,
"headers": {
"User-Agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36",
"Accept-Language": "en-US,en;q=0.9"
},
"cookies": {
"xf_csrf": "1jzOZZ7YpMu46XNP"
}
}QueryString fields:
url(querystring): The website you want to access.
JSON Body fields:
timeout: Max timeout in seconds for the request to answer (stopping the page loading wait if needed).stealth: Usetruefor enabling the stealth mode browser, andfalse(or not passing this field) to disable it.headers: The HTTP headers you want to send for the request. Use it forAuthorization,User-Agentand this kind of stuff.cookies: The HTTP cookies you want to send.
- Run
poetry installto install all the dependecies needed. Ensure you already have the correct python version needed (currently >= 3.11). - Then, run
make run-devto run it locally.