
Security News
Official Go SDK for MCP in Development, Stable Release Expected in August
The official Go SDK for the Model Context Protocol is in development, with a stable, production-ready release expected by August 2025.
browsing urls with cookies, that is, we can scrape with authenticated pages!
[Node.js] browsing urls with cookies, that is, we can scrape with authenticated pages!
git clone git://github.com/shinout/browser.git
OR
npm install browser
var browser = require("browser");
browser.browse("shinout.net", function(err, out) {
console.log(out.result);
});
var browser = require("browser");
var $b = new browser();
$b.browse('https://accounts.google.com/Login'); // browse this url
/* running on end of all browsings
* err: error object or null
* out: { result : result body, ...}
*/
$b.on("end", function(err, out) {
console.log(out.url, out.result, out.responseHeaders);
});
$b.run(); // execution
var userdata = {
email: "XXXXXX@gmail.com",
pass : "XXXXXXXX"
};
var $b = new browser();
$b.submit({
from : 'https://accounts.google.com/Login',
selector: "#gaia_loginform",
data : {
Email : userdata.email,
Passwd : userdata.pass
}
});
// authenticated access
$b.browse('https://mail.google.com/mail/u/0/?ui=html&zy=d')
.after(); // browse after previously registered function
/* running on end of all browsings
* err: error object or null
* out: { result : result body, ...}
*/
$b.on("end", function(err, out) {
console.log(out.url, out.result, out.responseHeaders);
});
var userdata = {
email: "XXXXXX@gmail.com",
pass : "XXXXXXXX"
};
var browser = require("browser");
var $b = new browser();
// $b.browse(the label of this request, url to access)
$b.browse('login', 'https://accounts.google.com/Login', {debug: true});
/* $b.browse(function(
* err : errors occured in the previous request,
* out : result of the previous browsing
*) { return url or return [url, options] }
*/
$b.browse(function(err, out) {
var jsdom = require("jsdom").jsdom;
var jquery = require("jquery");
var window = jsdom(out.result).createWindow();
var $ = jquery.create(window);
var postdata = {
Email : userdata.email,
Passwd : userdata.pass
};
var url = $("#gaia_loginform").attr("action");
// get hidden fields, and register them to post data
$("input").each(function(k, el) {
var $el = $(el);
var name = $el.attr("name"), type = $el.attr("type"), val = $el.val();
if (type == "hidden" || type == "submit") postdata[name] = val;
});
return [url, {
data : postdata, // set post data
method: "POST" // set HTTP method (default: GET)
}];
})
.after("login"); // browse after browsing with label="login"
$b.browse('https://mail.google.com/mail/u/0/?ui=html&zy=d')
.after(); // browse after previously registered function
$b.on("end", function(err, out) {
console.log(out.result);
});
$b.run();
option object to pass to $b.browse() is the same format as u2r options. See u2r in detail. The following are common options.
all other values below are automatically generated from URL
Feel free to contact @shinout!
FAQs
browsing urls with cookies, that is, we can scrape with authenticated pages!
The npm package browser receives a total of 3,677 weekly downloads. As such, browser popularity was classified as popular.
We found that browser demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
The official Go SDK for the Model Context Protocol is in development, with a stable, production-ready release expected by August 2025.
Security News
New research reveals that LLMs often fake understanding, passing benchmarks but failing to apply concepts or stay internally consistent.
Security News
Django has updated its security policies to reject AI-generated vulnerability reports that include fabricated or unverifiable content.