{ "cells": [ { "cell_type": "code", "execution_count": 8, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\n", " Example Domain\n", "\n", " \n", " \n", " \n", " \n", "\n", "\n", "\n", "
\n", "

Example Domain

\n", "

This domain is for use in illustrative examples in documents. You may use this\n", " domain in literature without prior coordination or asking for permission.

\n", "

More information...

\n", "
\n", "\n", "\n", "" ] } ], "source": [ "!curl -X POST http://192.168.1.101:3148/content \\\n", "-H 'Cache-Control: no-cache' -H 'Content-Type: application/json' -d '{\"url\": \"https://example.com/\" }'" ] }, { "cell_type": "code", "execution_count": 15, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "{'allowFileProtocol': False,\n", " 'chromeRefreshTime': 1800000,\n", " 'connectionTimeout': 600000,\n", " 'disabledFeatures': [],\n", " 'enableAPIGet': False,\n", " 'enableCors': False,\n", " 'enableHeapdump': False,\n", " 'errorAlertURL': None,\n", " 'exitOnHealthFailure': False,\n", " 'functionBuiltIns': ['url'],\n", " 'functionEnableIncognitoMode': False,\n", " 'functionEnvVars': [],\n", " 'functionExternals': ['lighthouse', 'node-pdftk', 'sharp'],\n", " 'healthFailureURL': None,\n", " 'host': '0.0.0.0',\n", " 'keepAlive': False,\n", " 'maxCPU': 99,\n", " 'maxConcurrentSessions': 10,\n", " 'maxMemory': 99,\n", " 'maxQueueLength': 20,\n", " 'metricsJSONPath': None,\n", " 'port': 3000,\n", " 'prebootChrome': False,\n", " 'queuedAlertURL': None,\n", " 'rejectAlertURL': None,\n", " 'sessionCheckFailURL': None,\n", " 'singleRun': False,\n", " 'socketBehavior': 'http',\n", " 'timeoutAlertURL': None,\n", " 'token': None,\n", " 'workspaceDir': '/home/browserless'}\n" ] } ], "source": [ "import requests\n", "import pprint\n", "response = requests.get('http://192.168.1.101:3148/config')\n", "\n", "pprint.pprint(response.json())\n", "\n", "\n" ] }, { "cell_type": "code", "execution_count": 16, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "{'error': 0,\n", " 'maxConcurrent': 1,\n", " 'maxTime': 600000,\n", " 'meanTime': 7610.974683544304,\n", " 'minTime': 0,\n", " 'queued': 0,\n", " 'rejected': 0,\n", " 'sessionTimes': [590, 600000, 947, 407],\n", " 'successful': 3,\n", " 'timedout': 1,\n", " 'totalTime': 601944,\n", " 'unhealthy': 0}\n" ] } ], "source": [ "import requests\n", "import pprint\n", "\n", "response = requests.get('http://192.168.1.101:3148/metrics/total')\n", "\n", "pprint.pprint(response.json())" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3.10.4 64-bit", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.10.4" }, "orig_nbformat": 4, "vscode": { "interpreter": { "hash": "31f2aee4e71d21fbe5cf8b01ff0e069b9275f58929596ceb00d14d90e3e16cd6" } } }, "nbformat": 4, "nbformat_minor": 2 }