Extracting Images with Mouse-Over

Discussion in 'Javascript' started by Dr. Lince M. Lawrence, Oct 21, 2004.

  1. Is there any method to extract both the images (with and without
    mouse-over) from a web site.

    Thanks,
    Lince M Lawrence
    Dr. Lince M. Lawrence, Oct 21, 2004
    #1
    1. Advertising

  2. Dr. Lince M. Lawrence

    Randy Webb Guest

    Dr. Lince M. Lawrence wrote:
    > Is there any method to extract both the images (with and without
    > mouse-over) from a web site.


    Yes.

    --
    Randy
    comp.lang.javascript FAQ - http://jibbering.com/faq
    Randy Webb, Oct 21, 2004
    #2
    1. Advertising

  3. Dr. Lince M. Lawrence

    McKirahan Guest

    "Dr. Lince M. Lawrence" <> wrote in message
    news:...
    > Is there any method to extract both the images (with and without
    > mouse-over) from a web site.
    >
    > Thanks,
    > Lince M Lawrence


    If you mean by right-clicking then no; well maybe, though I haven't tried
    it: perhaps (but I doubt it) if you turn off JavaScript then the
    "omouseover" won't be enabled.

    However, you can always view the source identify the "on" and "off" image
    naming convention (such as "image_on.gif" and "image_off.gif") then
    right-click on the "on" image, view Properties, cut-and-paste the URL into
    the address bar, then change the name to the "off" image.

    Or just cut-and-pase the image name from the source to the address bar
    keeping the prepended path.
    McKirahan, Oct 21, 2004
    #3
  4. Mr.Randy has said an 'YES'. Shall I assume that, the explanation given
    by Mr.McKirahan resembles your method.

    If yes or no. I am aware of what Mr.McKirahan has said. I am looking
    for some application which will help to extract the images. Either,
    the entire images of a page, or selected ones.


    Thanks,
    Lince M Lawrence
    Dr. Lince M. Lawrence, Oct 22, 2004
    #4
  5. Dr. Lince M. Lawrence

    McKirahan Guest

    "Dr. Lince M. Lawrence" <> wrote in message
    news:...
    > Mr.Randy has said an 'YES'. Shall I assume that, the explanation given
    > by Mr.McKirahan resembles your method.
    >
    > If yes or no. I am aware of what Mr.McKirahan has said. I am looking
    > for some application which will help to extract the images. Either,
    > the entire images of a page, or selected ones.
    >
    >
    > Thanks,
    > Lince M Lawrence


    This may be close to what you want.

    Watch for word-wrap.

    <html>
    <head>
    <title>images.htm</title>
    </head>
    <body>
    <code>
    <script type="text/javascript">
    var aURL = "http://www.google.com/";
    var sURL = prompt("Enter a URL:",aURL);
    var oIEA = new ActiveXObject("InternetExplorer.Application");
    oIEA.Navigate(sURL)
    while(oIEA.readyState != 4) {}
    var sBOR = " border='1'";
    if (!confirm("Show images with a border?")) sBOR = "";
    var oDIC = new ActiveXObject("Scripting.Dictionary");
    var sEXT;
    var sHTM = "";
    var iIMG = 0;
    var sIMG;
    var xIMG = "";
    var sLIN = "<hr align='left' width='700'>";
    for (var j=0; j<oIEA.document.images.length; j++) {
    sIMG = oIEA.document.images[j].src;
    if (sIMG.indexOf("?") > 0) {
    sIMG = sIMG.substr(0,sIMG.indexOf("?"));
    }
    sEXT = sIMG.substr(sIMG.length-4,sIMG.length).toLowerCase();
    if (sIMG != "" && "|.gif|.jpg|.jpeg|.png|".indexOf(sEXT) > 0) {
    if (!oDIC.Exists(sIMG)) {
    oDIC.Add(sIMG, "");
    iIMG++;
    xIMG += iIMG + ". " + sIMG + "<br>";
    sHTM += sLIN + iIMG + ". <img src='" + sIMG + "' alt='" +
    sIMG + "'" + sBOR + ">";
    }
    }
    }
    document.write("<b>" + sURL + "</b>&nbsp;(" + iIMG + " images)" + sLIN);
    document.write(xIMG + sHTM + sLIN);
    if (confirm("View " + sURL + "?")) {
    oIEA.visible = true;
    }
    </script>
    </code>
    </body>
    </html>


    However, a security warning is issued.

    Note that it can't detect "onMouseOver" images;
    so I guess it isn't your solution after all.

    "onMouseOver" images can be loaded in two ways;
    either by a direct reference to the image
    or by calling a function to swap the image.

    Also, the image name may be "constructed".
    Thus, what you want may not be doable.

    I hope to hear from others on this.
    McKirahan, Oct 22, 2004
    #5
  6. Dr. Lince M. Lawrence

    McKirahan Guest

    "Dr. Lince M. Lawrence" <> wrote in message
    news:...
    > Mr.Randy has said an 'YES'. Shall I assume that, the explanation given
    > by Mr.McKirahan resembles your method.
    >
    > If yes or no. I am aware of what Mr.McKirahan has said. I am looking
    > for some application which will help to extract the images. Either,
    > the entire images of a page, or selected ones.
    >
    >
    > Thanks,
    > Lince M Lawrence


    Another way is to copy them from cache.

    IE works better as it doesn't change the image's name.

    Depending on your OS, the images may be in a folder under:
    C:\WINDOWS\Temporary Internet Files\Content.IE5\
    McKirahan, Oct 22, 2004
    #6
  7. Dr. Lince M. Lawrence

    Randy Webb Guest

    Dr. Lince M. Lawrence wrote:

    > Mr.Randy has said an 'YES'. Shall I assume that, the explanation given
    > by Mr.McKirahan resembles your method.


    Not entirely but his approach works too. Getting the images for a web
    page is trivially easy though.

    > If yes or no. I am aware of what Mr.McKirahan has said. I am looking
    > for some application which will help to extract the images. Either,
    > the entire images of a page, or selected ones.


    As McKirahan pointed out, the cache is the simplest easiest way. Short
    of that, you could write an app that would parse the document for common
    image extensions, pull the names, build absolute paths, then create a
    dynamic page of img tags with the images. Then its just a matter of
    File>Save As in IE and it will save all the images. Might give me
    something to tinker with this weekend.

    --
    Randy
    comp.lang.javascript FAQ - http://jibbering.com/faq
    Randy Webb, Oct 22, 2004
    #7
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Davisro
    Replies:
    2
    Views:
    1,306
    Jim Corey
    Apr 23, 2004
  2. Max
    Replies:
    7
    Views:
    9,098
  3. Claus Atzenbeck
    Replies:
    1
    Views:
    1,080
    Claus Atzenbeck
    Nov 26, 2004
  4. Mel

    Mouse Over & Refresh of images ?

    Mel, Feb 28, 2005, in forum: Javascript
    Replies:
    3
    Views:
    101
    Randy Webb
    Feb 28, 2005
  5. Replies:
    1
    Views:
    94
Loading...

Share This Page