2:I[5294,["231","static/chunks/231-987d5c3e911703df.js","458","static/chunks/458-4089d99a84ebbe2b.js","235","static/chunks/235-5238db898b5afbf7.js","201","static/chunks/app/custom-proxies/page-655d765e75a2424a.js"],"Code"]
3:I[231,["231","static/chunks/231-987d5c3e911703df.js","458","static/chunks/458-4089d99a84ebbe2b.js","235","static/chunks/235-5238db898b5afbf7.js","201","static/chunks/app/custom-proxies/page-655d765e75a2424a.js"],""]
4:I[5294,["231","static/chunks/231-987d5c3e911703df.js","458","static/chunks/458-4089d99a84ebbe2b.js","235","static/chunks/235-5238db898b5afbf7.js","201","static/chunks/app/custom-proxies/page-655d765e75a2424a.js"],"Pre"]
5:I[5294,["231","static/chunks/231-987d5c3e911703df.js","458","static/chunks/458-4089d99a84ebbe2b.js","235","static/chunks/235-5238db898b5afbf7.js","201","static/chunks/app/custom-proxies/page-655d765e75a2424a.js"],"CodeGroup"]
7:I[2734,["231","static/chunks/231-987d5c3e911703df.js","458","static/chunks/458-4089d99a84ebbe2b.js","235","static/chunks/235-5238db898b5afbf7.js","201","static/chunks/app/custom-proxies/page-655d765e75a2424a.js"],"Heading"]
9:I[2403,["231","static/chunks/231-987d5c3e911703df.js","458","static/chunks/458-4089d99a84ebbe2b.js","235","static/chunks/235-5238db898b5afbf7.js","201","static/chunks/app/custom-proxies/page-655d765e75a2424a.js"],"Feedback"]
a:I[9275,[],""]
b:I[1343,[],""]
6:T248b,import { exitAll, GologinApi } from '../src/gologin-api.js';
const token = process.env.GOLOGIN_API_TOKEN; // get token https://app.gologin.com/personalArea/TokenApi
const gologin = GologinApi({ token, debug: true });
async function main() {
const { browser } = await gologin.launch({ proxy: {
mode: 'http',
host: 'proxy_host',
port: 'proxy_port',
username: 'proxy_username',
password: 'proxy_password',
},
});
const page = await browser.newPage();
await page.goto('https://iphey.com/', { waitUntil: 'networkidle2' });
const status = await page.$eval('.trustworthy-status:not(.hide)', (elt) =>
elt?.innerText?.trim(),
);
return status; // Expecting 'Trustworthy'
}
main().catch(console.error).then(console.info).finally(exitAll);
8:T4a9,git clone git@github.com:gologinapp/gologin.git
cd gologin
npm install
GL_API_TOKEN=[YOUR_GOLOGIN_API_TOKEN] node examples/example-custom-proxy.js
0:["6ZCz-VlG0khrc3itF4UQu",[[["",{"children":["custom-proxies",{"children":["__PAGE__",{}]}]},"$undefined","$undefined",true],["",{"children":["custom-proxies",{"children":["__PAGE__",{},[["$L1",["$","article",null,{"className":"flex h-full flex-col pb-10 pt-16","children":[["$","div",null,{"className":"flex-auto prose dark:prose-invert [html_:where(&>*)]:mx-auto [html_:where(&>*)]:max-w-2xl [html_:where(&>*)]:lg:mx-[calc(50%-min(50%,theme(maxWidth.lg)))] [html_:where(&>*)]:lg:max-w-3xl","children":[["$","h1",null,{"children":"Using proxy for scrapping"}],"\n",["$","p",null,{"children":["To make scrapping browser start with a custom proxy add\n",["$","$L2",null,{"children":"proxy: { /** list of proxy fields */ }"}]," to the list\nof params when calling the ",["$","$L2",null,{"children":"launch()"}]," function."]}],"\n",["$","div",null,{"className":"my-6 flex gap-2.5 rounded-2xl border border-emerald-500/20 bg-emerald-50/50 p-4 leading-6 text-emerald-900 dark:border-emerald-500/30 dark:bg-emerald-500/5 dark:text-emerald-200 dark:[--tw-prose-links-hover:theme(colors.emerald.300)] dark:[--tw-prose-links:theme(colors.white)]","children":[["$","svg",null,{"viewBox":"0 0 16 16","aria-hidden":"true","className":"mt-1 h-4 w-4 flex-none fill-emerald-500 stroke-white dark:fill-emerald-200/20 dark:stroke-emerald-200","children":[["$","circle",null,{"cx":"8","cy":"8","r":"8","strokeWidth":"0"}],["$","path",null,{"fill":"none","strokeLinecap":"round","strokeLinejoin":"round","strokeWidth":"1.5","d":"M6.75 7.75h1.5v3.5"}],["$","circle",null,{"cx":"8","cy":"4","r":".5","fill":"none"}]]}],["$","div",null,{"className":"[&>:first-child]:mt-0 [&>:last-child]:mb-0","children":[["$","p",null,{"children":["We highly recommend using ",["$","$L3",null,{"href":"/provided-proxies","children":"provided proxies"}]," instead of custom proxies because of"]}],["$","ul",null,{"children":["\n",["$","li",null,{"children":"much easier to setup of provided proxies"}],"\n",["$","li",null,{"children":"well-tested compatibility between browser, automation API, reCaptcha, proxies and other anti-detect technologies"}],"\n",["$","li",null,{"children":"single support point"}],"\n",["$","li",null,{"children":"flexibility in changing locations and other params when you need it"}],"\n"]}]]}]]}],"\n",["$","$L4",null,{"code":" const { browser } = await gologin.launch({\n proxy: {\n mode: 'http',\n host: 'proxy_host',\n port: 'proxy_port',\n username: 'proxy_username',\n password: 'proxy_password',\n },\n });\n","children":["$","$L2",null,{"children":" const { browser } = await gologin.launch({\n proxy: {\n mode: 'http',\n host: 'proxy_host',\n port: 'proxy_port',\n username: 'proxy_username',\n password: 'proxy_password',\n },\n });\n"}]}],"\n",["$","h1",null,{"children":"Benefits of running scraping browser with proxies"}],"\n",["$","ul",null,{"children":["\n",["$","li",null,{"children":"Bypass geo-restrictions by selecting specific country codes for proxies."}],"\n",["$","li",null,{"children":"Improve scraping efficiency with reduced chances of IP bans."}],"\n",["$","li",null,{"children":"Maintain anonymity and privacy during web scraping activities."}],"\n",["$","li",null,{"children":"Access localized content for more accurate and relevant data collection."}],"\n",["$","li",null,{"children":"Increase success rates of data retrieval with diverse proxy options."}],"\n"]}],"\n",["$","div",null,{"className":"my-6 flex gap-2.5 rounded-2xl border border-emerald-500/20 bg-emerald-50/50 p-4 leading-6 text-emerald-900 dark:border-emerald-500/30 dark:bg-emerald-500/5 dark:text-emerald-200 dark:[--tw-prose-links-hover:theme(colors.emerald.300)] dark:[--tw-prose-links:theme(colors.white)]","children":[["$","svg",null,{"viewBox":"0 0 16 16","aria-hidden":"true","className":"mt-1 h-4 w-4 flex-none fill-emerald-500 stroke-white dark:fill-emerald-200/20 dark:stroke-emerald-200","children":[["$","circle",null,{"cx":"8","cy":"8","r":"8","strokeWidth":"0"}],["$","path",null,{"fill":"none","strokeLinecap":"round","strokeLinejoin":"round","strokeWidth":"1.5","d":"M6.75 7.75h1.5v3.5"}],["$","circle",null,{"cx":"8","cy":"4","r":".5","fill":"none"}]]}],["$","div",null,{"className":"[&>:first-child]:mt-0 [&>:last-child]:mb-0","children":[["$","p",null,{"children":["We highly recommend using ",["$","$L3",null,{"href":"/provided-proxies","children":"provided proxies"}]," for the following reasons:"]}],["$","ul",null,{"children":["\n",["$","li",null,{"children":"much easier to setup of provided proxies"}],"\n",["$","li",null,{"children":"well-tested compatibility between browser, automation API, reCaptcha, proxies and other anti-detect technologies"}],"\n",["$","li",null,{"children":"single support point"}],"\n",["$","li",null,{"children":"flexibility in changing locations and other params when you need it"}],"\n"]}]]}]]}],"\n",["$","h3",null,{"children":"Code sample: custom proxy for scrapping"}],"\n",["$","$L5",null,{"tag":"headless","label":"Run headless browser","children":[["$","$L4",null,{"language":"js","code":"import { exitAll, GologinApi } from '../src/gologin-api.js';\n\nconst token = process.env.GOLOGIN_API_TOKEN; // get token https://app.gologin.com/personalArea/TokenApi\nconst gologin = GologinApi({ token, debug: true });\n\nasync function main() {\n const { browser } = await gologin.launch({ proxy: {\n mode: 'http',\n host: 'proxy_host',\n port: 'proxy_port',\n username: 'proxy_username',\n password: 'proxy_password',\n },\n });\n const page = await browser.newPage();\n await page.goto('https://iphey.com/', { waitUntil: 'networkidle2' });\n const status = await page.$eval('.trustworthy-status:not(.hide)', (elt) =>\n elt?.innerText?.trim(),\n );\n\n return status; // Expecting 'Trustworthy'\n}\n\nmain().catch(console.error).then(console.info).finally(exitAll);\n\n","children":["$","$L2",null,{"className":"language-js","children":"$6"}]}],["$","$L4",null,{"language":"python","code":"PYTHON\n\n","children":["$","$L2",null,{"className":"language-python","children":"PYTHON\n\n"}]}]]}],"\n",["$","$L7",null,{"level":2,"id":"clone-and-run-headless-scraping-browser-code-sample","children":"Clone and run headless scraping browser code sample"}],"\n",["$","p",null,{"children":"Start with pre-build and tested code example:"}],"\n",["$","$L5",null,{"tag":"github.com","label":"Run scrapping example","children":["$","$L4",null,{"language":"bash","code":"git clone git@github.com:gologinapp/gologin.git\ncd gologin\nnpm install\n\nGL_API_TOKEN=[YOUR_GOLOGIN_API_TOKEN] node examples/example-custom-proxy.js\n","children":["$","$L2",null,{"className":"language-bash","children":"$8"}]}]}],"\n",["$","div",null,{"className":"my-6 flex gap-2.5 rounded-2xl border border-emerald-500/20 bg-emerald-50/50 p-4 leading-6 text-emerald-900 dark:border-emerald-500/30 dark:bg-emerald-500/5 dark:text-emerald-200 dark:[--tw-prose-links-hover:theme(colors.emerald.300)] dark:[--tw-prose-links:theme(colors.white)]","children":[["$","svg",null,{"viewBox":"0 0 16 16","aria-hidden":"true","className":"mt-1 h-4 w-4 flex-none fill-emerald-500 stroke-white dark:fill-emerald-200/20 dark:stroke-emerald-200","children":[["$","circle",null,{"cx":"8","cy":"8","r":"8","strokeWidth":"0"}],["$","path",null,{"fill":"none","strokeLinecap":"round","strokeLinejoin":"round","strokeWidth":"1.5","d":"M6.75 7.75h1.5v3.5"}],["$","circle",null,{"cx":"8","cy":"4","r":".5","fill":"none"}]]}],["$","div",null,{"className":"[&>:first-child]:mt-0 [&>:last-child]:mb-0","children":[["$","p",null,{"children":["We highly recommend using ",["$","$L3",null,{"href":"/provided-proxies","children":"provided proxies"}]," for the the following reasons:"]}],["$","ul",null,{"children":["\n",["$","li",null,{"children":"much easier setup of provided proxies"}],"\n",["$","li",null,{"children":"well-tested compatibility between browser, automation API, reCaptcha, proxies and other anti-detect technologies"}],"\n",["$","li",null,{"children":"single support point"}],"\n",["$","li",null,{"children":"flexibility in changing locations and other params when you need it"}],"\n"]}]]}]]}],"\n",["$","$L7",null,{"level":2,"id":"whats-next","children":"What's next?"}],"\n",["$","p",null,{"children":"Great, you're now set up with an API client and have made your first request to the API. Here are a few links that might be handy as you venture further into the GoLogin API:"}],"\n",["$","ul",null,{"children":["\n",["$","li",null,{"children":["$","$L3",null,{"href":"https://app.gologin.com/personalArea/TokenApi","children":"Grab your API key from the Settings > API"}]}],"\n",["$","li",null,{"children":["$","$L3",null,{"href":"/provided-proxies","children":"Use provided proxies"}]}],"\n"]}]]}],["$","footer",null,{"className":"mx-auto mt-16 w-full max-w-2xl lg:max-w-5xl","children":["$","$L9",null,{}]}]]}]],null],null]},["$","$La",null,{"parallelRouterKey":"children","segmentPath":["children","custom-proxies","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$Lb",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined","styles":null}],null]},["$Lc",null],null],[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/027cc402be06af88.css","precedence":"next","crossOrigin":"$undefined"}]],"$Ld"]]]]
d:[["$","meta","0",{"name":"viewport","content":"width=device-width, initial-scale=1"}],["$","meta","1",{"charSet":"utf-8"}],["$","title","2",{"children":"Using headless mode browser for scrapping - GoLogin API Reference"}],["$","meta","3",{"name":"description","content":"Setup custom proxies with GoLogin API to make scraping requests"}],["$","link","4",{"rel":"icon","href":"/favicon.ico","type":"image/x-icon","sizes":"16x16"}]]
1:null
e:I[2650,["231","static/chunks/231-987d5c3e911703df.js","458","static/chunks/458-4089d99a84ebbe2b.js","533","static/chunks/533-463131cc62f06a62.js","173","static/chunks/173-fc203c72e72da31b.js","192","static/chunks/192-bdca0343973e6cb5.js","235","static/chunks/235-5238db898b5afbf7.js","185","static/chunks/app/layout-1476186cd824e018.js"],"Providers"]
f:I[7010,["231","static/chunks/231-987d5c3e911703df.js","458","static/chunks/458-4089d99a84ebbe2b.js","533","static/chunks/533-463131cc62f06a62.js","173","static/chunks/173-fc203c72e72da31b.js","192","static/chunks/192-bdca0343973e6cb5.js","235","static/chunks/235-5238db898b5afbf7.js","185","static/chunks/app/layout-1476186cd824e018.js"],"Layout"]
10:I[4080,["231","static/chunks/231-987d5c3e911703df.js","458","static/chunks/458-4089d99a84ebbe2b.js","533","static/chunks/533-463131cc62f06a62.js","173","static/chunks/173-fc203c72e72da31b.js","192","static/chunks/192-bdca0343973e6cb5.js","235","static/chunks/235-5238db898b5afbf7.js","185","static/chunks/app/layout-1476186cd824e018.js"],""]
11:T47c,
const APP_ID = 'izr1nygf';
const user = {
// user_id: 1,
// email: 'dima.kaigorod@gmail.com',
// name: ''
};
window.intercomSettings = {
api_base: "https://api-iam.intercom.io",
app_id: APP_ID,
user_id: user.user_id, // IMPORTANT: Replace "user.id" with the variable you use to capture the user's ID
name: user.name, // IMPORTANT: Replace "user.name" with the variable you use to capture the user's name
email: user.email, // IMPORTANT: Replace "user.email" with the variable you use to capture the user's email address
};
(function(){var w=window;var ic=w.Intercom;if(typeof ic==="function"){ic('update',w.intercomSettings);}else{var d=document;var i=function(){i.c(arguments);};i.q=[];i.c=function(args){i.q.push(args);};w.Intercom=i;var l=function(){var s=d.createElement('script');s.type='text/javascript';s.async=true;s.src='https://widget.intercom.io/widget/' + APP_ID;var x=d.getElementsByTagName('script')[0];x.parentNode.insertBefore(s, x);};if(document.readyState==='complete'){l();}else if(w.attachEvent){w.attachEvent('onload',l);}else{w.addEventListener('load',l,false);}}})();
c:["$","html",null,{"lang":"en","className":"h-full","suppressHydrationWarning":true,"children":["$","body",null,{"className":"flex min-h-full bg-white antialiased dark:bg-zinc-900","children":[["$","$Le",null,{"children":["$","div",null,{"className":"w-full","children":["$","$Lf",null,{"allSections":{"/":[{"title":"Guides","id":"guides"},{"title":"Resources","id":"resources"}],"/authentication":[{"title":"OAuth2 with bearer token","id":"o-auth2-with-bearer-token"},{"title":"Using an GologinApi instance","id":"using-an-gologin-api-instance"},{"title":"Using an SDK","id":"using-an-sdk"}],"/attachments":[{"title":"The attachment model","id":"the-attachment-model"},{"title":"List all attachments","id":"list-all-attachments","tag":"GET","label":"/v1/attachments"},{"title":"Create an attachment","id":"create-an-attachment","tag":"POST","label":"/v1/attachments"},{"title":"Retrieve an attachment","id":"retrieve-an-attachment","tag":"GET","label":"/v1/attachments/:id"},{"title":"Update an attachment","id":"update-an-attachment","tag":"PUT","label":"/v1/attachments/:id"},{"title":"Delete an attachment","id":"delete-an-attachment","tag":"DELETE","label":"/v1/attachments/:id"}],"/contacts":[{"title":"The contact model","id":"the-contact-model"},{"title":"List all contacts","id":"list-all-contacts","tag":"GET","label":"/v1/contacts"},{"title":"Create a contact","id":"create-a-contact","tag":"POST","label":"/v1/contacts"},{"title":"Retrieve a contact","id":"retrieve-a-contact","tag":"GET","label":"/v1/contacts/:id"},{"title":"Update a contact","id":"update-a-contact","tag":"PUT","label":"/v1/contacts/:id"},{"title":"Delete a contact","id":"delete-a-contact","tag":"DELETE","label":"/v1/contacts/:id"}],"/errors":[{"title":"Status codes","id":"status-codes"},{"title":"Error types","id":"error-types"}],"/headless":[{"title":"Clone and run headless scraping browser code sample","id":"clone-and-run-headless-scraping-browser-code-sample"},{"title":"What's next?","id":"whats-next"}],"/custom-proxies":[{"title":"Clone and run headless scraping browser code sample","id":"clone-and-run-headless-scraping-browser-code-sample"},{"title":"What's next?","id":"whats-next"}],"/conversations":[{"title":"The conversation model","id":"the-conversation-model"},{"title":"List all conversations","id":"list-all-conversations","tag":"GET","label":"/v1/conversations"},{"title":"Create a conversation","id":"create-a-conversation","tag":"POST","label":"/v1/conversations"},{"title":"Retrieve a conversation","id":"retrieve-a-conversation","tag":"GET","label":"/v1/conversations/:id"},{"title":"Update a conversation","id":"update-a-conversation","tag":"PUT","label":"/v1/conversations/:id"},{"title":"Delete a conversation","id":"delete-a-conversation","tag":"DELETE","label":"/v1/conversations/:id"}],"/cloud":[{"title":"Make your first run of browser in the cloud","id":"make-your-first-run-of-browser-in-the-cloud"},{"title":"Running code yourself","id":"running-code-yourself"},{"title":"What's next?","id":"whats-next"}],"/quickstart":[{"title":"Making your first anonymous scrapping request","id":"making-your-first-anonymous-scrapping-request"},{"title":"What this script does, step by step","id":"what-this-script-does-step-by-step"},{"title":"Running code yourself","id":"running-code-yourself"},{"title":"What's next?","id":"whats-next"}],"/sdks":[{"title":"Official libraries","id":"official-libraries"}],"/recaptcha":[{"title":"Making your first anonymous scrapping request","id":"making-your-first-anonymous-scrapping-request"},{"title":"What this script does, step by step","id":"what-this-script-does-step-by-step"},{"title":"Running code yourself","id":"running-code-yourself"},{"title":"What's next?","id":"whats-next"}],"/profiles":[{"title":"List all groups","id":"list-all-groups","tag":"GET","label":"/v1/groups"},{"title":"Create a group","id":"create-a-group","tag":"POST","label":"/v1/groups"},{"title":"Retrieve a group","id":"retrieve-a-group","tag":"GET","label":"/v1/groups/:id"},{"title":"Update a group","id":"update-a-group","tag":"PUT","label":"/v1/groups/:id"},{"title":"Delete a group","id":"delete-a-group","tag":"DELETE","label":"/v1/groups/:id"}],"/provided-proxies":[{"title":"Clone and run headless scraping browser code sample","id":"clone-and-run-headless-scraping-browser-code-sample"},{"title":"What's next?","id":"whats-next"}]},"children":["$","$La",null,{"parallelRouterKey":"children","segmentPath":["children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$Lb",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","div",null,{"className":"absolute inset-0 -z-10 mx-0 max-w-none overflow-hidden","children":["$","div",null,{"className":"absolute left-1/2 top-0 ml-[-38rem] h-[25rem] w-[81.25rem] dark:[mask-image:linear-gradient(white,transparent)]","children":[["$","div",null,{"className":"absolute inset-0 bg-gradient-to-r from-[#36b49f] to-[#DBFF75] opacity-40 [mask-image:radial-gradient(farthest-side_at_top,white,transparent)] dark:from-[#36b49f]/30 dark:to-[#DBFF75]/30 dark:opacity-100","children":["$","svg",null,{"aria-hidden":"true","className":"absolute inset-x-0 inset-y-[-50%] h-[200%] w-full skew-y-[-18deg] fill-black/40 stroke-black/50 mix-blend-overlay dark:fill-white/2.5 dark:stroke-white/5","children":[["$","defs",null,{"children":["$","pattern",null,{"id":":S1:","width":72,"height":56,"patternUnits":"userSpaceOnUse","x":-12,"y":4,"children":["$","path",null,{"d":"M.5 56V.5H72","fill":"none"}]}]}],["$","rect",null,{"width":"100%","height":"100%","strokeWidth":0,"fill":"url(#:S1:)"}],["$","svg",null,{"x":-12,"y":4,"className":"overflow-visible","children":[["$","rect","4-3",{"strokeWidth":"0","width":73,"height":57,"x":288,"y":168}],["$","rect","2-1",{"strokeWidth":"0","width":73,"height":57,"x":144,"y":56}],["$","rect","7-3",{"strokeWidth":"0","width":73,"height":57,"x":504,"y":168}],["$","rect","10-6",{"strokeWidth":"0","width":73,"height":57,"x":720,"y":336}]]}]]}]}],["$","svg",null,{"viewBox":"0 0 1113 440","aria-hidden":"true","className":"absolute left-1/2 top-0 ml-[-19rem] w-[69.5625rem] fill-white blur-[26px] dark:hidden","children":["$","path",null,{"d":"M.016 439.5s-9.5-300 434-300S882.516 20 882.516 20V0h230.004v439.5H.016Z"}]}]]}]}],["$","div",null,{"className":"mx-auto flex h-full max-w-xl flex-col items-center justify-center py-16 text-center","children":[["$","p",null,{"className":"text-sm font-semibold text-zinc-900 dark:text-white","children":"404"}],["$","h1",null,{"className":"mt-2 text-2xl font-bold text-zinc-900 dark:text-white","children":"Page not found"}],["$","p",null,{"className":"mt-2 text-base text-zinc-600 dark:text-zinc-400","children":"Sorry, we couldn’t find the page you’re looking for."}],["$","$L3",null,{"className":"inline-flex gap-0.5 justify-center overflow-hidden text-sm font-medium transition rounded-full bg-zinc-900 py-1 px-3 text-white hover:bg-zinc-700 dark:bg-emerald-400/10 dark:text-emerald-400 dark:ring-1 dark:ring-inset dark:ring-emerald-400/20 dark:hover:bg-emerald-400/10 dark:hover:text-emerald-300 dark:hover:ring-emerald-300 mt-8","href":"/","children":[false,"Back to docs",["$","svg",null,{"viewBox":"0 0 20 20","fill":"none","aria-hidden":"true","className":"mt-0.5 h-5 w-5 -mr-1","children":["$","path",null,{"stroke":"currentColor","strokeLinecap":"round","strokeLinejoin":"round","d":"m11.5 6.5 3 3.5m0 0-3 3.5m3-3.5h-9"}]}]]}]]}]],"notFoundStyles":[],"styles":null}]}]}]}],["$","$L10",null,{"id":"intercom","dangerouslySetInnerHTML":{"__html":"$11"}}]]}]}]