Timeline for How to download pictures from webpage automatically?
Current License: CC BY-SA 3.0
13 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Jun 16, 2020 at 9:23 | history | edited | CommunityBot |
Commonmark migration
|
|
Jul 24, 2016 at 9:38 | history | edited | J. M.'s missing motivation♦ |
edited tags
|
|
Mar 9, 2015 at 21:13 | history | tweeted | twitter.com/#!/StackMma/status/575041770905542656 | ||
Mar 9, 2015 at 2:53 | vote | accept | xyz | ||
Mar 8, 2015 at 18:54 | comment | added | Jens |
I agree with @kirma and think the title should be modified to restrict focus on img elements specifically. There are so many other ways of putting "pictures" on web pages (especially in HTML5 , e.g., svg , canvas , and yes: plugins like CDF and Flash , etc. etc.) that the question seems too broad.
|
|
Mar 8, 2015 at 9:23 | comment | added | C. E.♦ | @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. | |
Mar 8, 2015 at 9:21 | comment | added | C. E.♦ |
@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.
|
|
Mar 8, 2015 at 8:45 | comment | added | kirma | @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. | |
Mar 8, 2015 at 7:43 | comment | added | C. E.♦ | @kirma It's also good to note that since Javascript is just a scripting language like Mathematica, it can't do anything Mathematica can't. If we download the source code we have access to the same data that the Javascript script has, and if it manages to find image URLs in the source code then so can we (as wuyingddg has shown). | |
Mar 8, 2015 at 6:48 | answer | added | wuyingddg | timeline score: 12 | |
Mar 8, 2015 at 6:39 | comment | added | wuyingddg | kylen314.com/archives/1647 This article maybe helpful | |
Mar 8, 2015 at 6:28 | comment | added | kirma |
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.
|
|
Mar 8, 2015 at 6:17 | history | asked | xyz | CC BY-SA 3.0 |