This is a further question of this post. Actually this code from SqRoots.And this code has completed the task.

(I assume you are using Mozilla Firefox and MMA version 11.0)

c=SQLExecute[conn,"select * from moz_cookies where baseDomain like '%.stackexchange.com'"];
Quiet[DeleteFile[StringReplace[file, "txt" -> "html"]]];

After you run this code,you will get the website like:


This is what I want exactly.But I'm a little unhappy with the use of package DatabaseLink and that command of SQL.I think we can use the new function FindCookies to replace it.But I don't know how to realize it.

Question: How to use FindCookies to get that cookie?


1 Answer 1


[More of an extended comment]

The new cookie functionality in Mathematica 11.0 is built around CURLLink / libcurl, hence the cookie storage format is the cookiejar (Netscape cookie file) which is a plain text file with each cookie on a separate line.

Since Firefox stores the cookies in a sqlite database, they would not be directly accessible to FindCookies and friends. Of course, there are tools available to export the cookies in this format, but that's similar in spirit to what you are already doing.

  • $\begingroup$ You can show that if it can omit that command of SQL. $\endgroup$
    – yode
    Commented Sep 7, 2016 at 14:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.