开发者

Using LWP in Perl how to transfer the cookies to a browser

Consider a site having 10 pages(like shopcart process) and login. I need to browse upto 5 pages using Perl LWP, then transfer the cookies and sessions to a browser like Chrome and then continue till the 10th page there, without giving th开发者_JAVA技巧e login info again. Is this possible ? If so please direct me on this...

Thanks Vivek


Yes, it's possible. If using a different browser than Chromium, store your LWP cookie jar with HTTP-Cookies or HTTP-Cookies-Opera.

If using Chromium, you have to program this on your own. The store is a straight-forward Sqlite3 database.

$ echo .schema | sqlite3 ~/.config/chromium/Default/Cookies
CREATE TABLE cookies (creation_utc INTEGER NOT NULL UNIQUE PRIMARY KEY,host_key TEXT NOT NULL,name TEXT NOT NULL,value TEXT NOT NULL,path TEXT NOT NULL,expires_utc INTEGER NOT NULL,secure INTEGER NOT NULL,httponly INTEGER NOT NULL,last_access_utc INTEGER NOT NULL);
CREATE TABLE meta(key LONGVARCHAR NOT NULL UNIQUE PRIMARY KEY,value LONGVARCHAR);
CREATE INDEX cookie_times ON cookies (creation_utc);

I can recommend DBIx::Class::Schema::Loader for accessing it.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜