You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
4.9 KiB
4.9 KiB
<html>
<head>
</head>
</html>
In [8]:
!curl -X POST http://192.168.1.101:3148/content \
-H 'Cache-Control: no-cache' -H 'Content-Type: application/json' -d '{"url": "https://example.com/" }'
<!DOCTYPE html><html><head>
<title>Example Domain</title>
<meta charset="utf-8">
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<style type="text/css">
body {
background-color: #f0f0f2;
margin: 0;
padding: 0;
font-family: -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
}
div {
width: 600px;
margin: 5em auto;
padding: 2em;
background-color: #fdfdff;
border-radius: 0.5em;
box-shadow: 2px 3px 7px 2px rgba(0,0,0,0.02);
}
a:link, a:visited {
color: #38488f;
text-decoration: none;
}
@media (max-width: 700px) {
div {
margin: 0 auto;
width: auto;
}
}
</style>
</head>
<body>
<div>
<h1>Example Domain</h1>
<p>This domain is for use in illustrative examples in documents. You may use this
domain in literature without prior coordination or asking for permission.</p>
<p><a href="https://www.iana.org/domains/example">More information...</a></p>
</div>
</body></html>
In [15]:
import requests
import pprint
response = requests.get('http://192.168.1.101:3148/config')
pprint.pprint(response.json())
{'allowFileProtocol': False,
'chromeRefreshTime': 1800000,
'connectionTimeout': 600000,
'disabledFeatures': [],
'enableAPIGet': False,
'enableCors': False,
'enableHeapdump': False,
'errorAlertURL': None,
'exitOnHealthFailure': False,
'functionBuiltIns': ['url'],
'functionEnableIncognitoMode': False,
'functionEnvVars': [],
'functionExternals': ['lighthouse', 'node-pdftk', 'sharp'],
'healthFailureURL': None,
'host': '0.0.0.0',
'keepAlive': False,
'maxCPU': 99,
'maxConcurrentSessions': 10,
'maxMemory': 99,
'maxQueueLength': 20,
'metricsJSONPath': None,
'port': 3000,
'prebootChrome': False,
'queuedAlertURL': None,
'rejectAlertURL': None,
'sessionCheckFailURL': None,
'singleRun': False,
'socketBehavior': 'http',
'timeoutAlertURL': None,
'token': None,
'workspaceDir': '/home/browserless'}
In [16]:
import requests
import pprint
response = requests.get('http://192.168.1.101:3148/metrics/total')
pprint.pprint(response.json())
{'error': 0,
'maxConcurrent': 1,
'maxTime': 600000,
'meanTime': 7610.974683544304,
'minTime': 0,
'queued': 0,
'rejected': 0,
'sessionTimes': [590, 600000, 947, 407],
'successful': 3,
'timedout': 1,
'totalTime': 601944,
'unhealthy': 0}