Today, I read a good web page about love which owns many beautiful pictures. It is fussy for me to download every picture hand-by-hand, so I'd like to use Mathematica to do this case automatically.

I searched the documentation, then I found Import is a relate function.

Trial:

Import["http://mp.weixin.qq.com/s?__biz=MzA5NDY3OTAyNA==&mid=205311623&idx=1&sn=7b565a6ed5789732f698d5a6b4c5c652&scene=2&from=timeline&isappinstalled=0#rd", "Images"]


Obviously, this trial was failed.

Question

Is it possible to download pictures from web page automatically? Any suggestions or hints?

• Many (but by no means all) modern web sites rely heavily on mechanisms such as Javascript. HTML parser that Import uses to find images on a web page doesn't understand these mechanisms, and can find only those images directly linked from the HTML document. In this case, they are the pen and progress indicator, rest of images are delivered through other means. I don't believe there is a built-in way to emulate a whole browser in built-in functionality of current Mathematica. – kirma Mar 8 '15 at 6:28
• @Pickett This is of course true, but unless we want to be overly abstract, it has to be recognized that collecting data - for instance all images an user might consider to be present on a web page while she reads it - needs to emulate a browser (which is computably feasible for Mma), but might even require emulating user interaction, such as scrolling the page. Solution by wuyingddg is valid in this specific situation, but by no means universal solution to a general, unfortunate problem that arises in the modern Web. – kirma Mar 8 '15 at 8:45
• @kirma For most websites the case is that the logic Javascript carries out is quite simple and what you really want to get your hands on is the input data (e.g. image URLs.) This is (for reusability and ease-of-use reasons) stored in the HTML itself, and usually in well known places such as data attributes. With jSoupLink we can extract the input data with the same syntax that you would use in Javascript, so it's not harder or easier in Mathematica than in Javascript. – C. E. Mar 8 '15 at 9:21
• @kirma There are some websites that are very complicated with a lot of non-trivial Javascript, but I classify those as web applications (think Google Docs). In those cases it can be hard to locate what you're looking for. But the vast majority of websites are not like that. – C. E. Mar 8 '15 at 9:23

st = Import[