How to save the web page content? help!

i'm doing 'saveAs' button in order to save all the web content. I'm using ole automation. Can help me to check how to modify my code in order to run 'saveAs' function'? I'm stucked at the code shown below as i would like to insert the web content instead of "tre" tat i assigned. how to do that? thanks
// Enter text
dispIDs = objSelection.getIDsOfNames(new String[] {"TypeText"});
System.out.print(dispIDs.toString());
objSelection.invoke(dispIDs[0], new Variant[] {new Variant("tre")});
the save method is as shown below:
public void save(){
          String fileName = "c:\\test\\tmpdoc01.doc";
          OleClientSite site = new OleClientSite(webFrame, SWT.NONE, "Word.Application");
          OleAutomation objApplication = new OleAutomation(site);
// Get Documents object
int[] dispIDs = objApplication.getIDsOfNames(new String[] {"Documents"});
Variant varResult = objApplication.getProperty(dispIDs[0]);
if (varResult != null && varResult.getType() != OLE.VT_EMPTY) {
OleAutomation objDocuments = varResult.getAutomation();
varResult.dispose();
// Add Document file
dispIDs = objDocuments.getIDsOfNames(new String[] {"Add"});
varResult = objDocuments.invoke(dispIDs[0]);
if (varResult != null && varResult.getType()!= OLE.VT_EMPTY) {
OleAutomation objDocument = varResult.getAutomation();
varResult.dispose();
// Get Selection object
dispIDs = objApplication.getIDsOfNames(new String[] {"Selection"});
varResult = objApplication.getProperty(dispIDs[0]);
if (varResult != null && varResult.getType() != OLE.VT_EMPTY) {
OleAutomation objSelection = varResult.getAutomation();
varResult.dispose();
// Enter text
dispIDs = objSelection.getIDsOfNames(new String[] {"TypeText"});
System.out.print(dispIDs.toString());
objSelection.invoke(dispIDs[0], new Variant[] {new Variant("tre")});
objSelection.dispose();
// Save Document file
dispIDs = objDocument.getIDsOfNames(new String[] {"SaveAs"});
objDocument.invoke(dispIDs[0], new Variant[] {new Variant(fileName)});
// Close Document file
dispIDs = objDocument.getIDsOfNames(new String[] {"Close"});
objDocument.invoke(dispIDs[0]);
objDocument.dispose();
objDocuments.dispose();
// Quit Application
dispIDs = objApplication.getIDsOfNames(new String[] {"Quit"});
objApplication.invoke(dispIDs[0]);
objApplication.dispose();
     }

import java.io.*;
import java.net.*;
class SiteSaver {
     public static void main(String[] argv) throws Exception {
          if( argv.length != 2 ) usage();
          BufferedWriter bw = new BufferedWriter(new FileWriter(argv[0]));
          URL url = new URL(argv[1]);
          BufferedReader br = new BufferedReader(new InputStreamReader(url.openStream()));
          String input;
          while( (input = br.readLine()) != null ) {
               bw.write(input);
          br.close();
          bw.close();
          System.out.println("Contents of \"" + argv[1] + "\" have been saved to the file \"" + argv[0] + "\"");
     private static void usage() {
          System.out.println("usage: java SiteSaver [filename] [url]");
          System.exit(1);
}

Similar Messages

  • How can I save the web page by using the Page Title as the file name ?

    When i use Internet Explorer ,I can save the web page by using Page Title as the file name(as default no need to adjust anything). But when i use Firefox ,It can not use the Page Title to save as the file name. How can I do that like in Internet Explorer?

    See:
    *File Title: https://addons.mozilla.org/firefox/addon/834
    *Title Save: https://addons.mozilla.org/firefox/addon/712

  • I can't copy/save pictures of items on ebay. I can only save the web page. I can copy/save with IE. Why?

    On items listed on ebay, you can click on a picture to enlarge it. With IE I can save the picture to my computer. Firefox only allows me to save the web page. What can I do to save pictures - .jpg or .bmp?
    The same problem happens if the seller includes pictures in the text description.

    Now I cannot create a screenshot because the massage doesn't appear anymore.
    I was told that this is not my problem only. Is it the recent update that broke somethng? I've all the accounts configured correctly, MT just doesn't send or download messages.
    I tried to remove one of my accounts to re-set it, but when I tried to configure it once again Mozilla rejects it claiming the password is wrong. I triple checked, it's correct.

  • How to change the web page title of a web dynpro app?

    Hello,
    I would like to change the HTML page title of a web dynpro application without renaming the application component itself - but how?
    Thanks for your comments!

    Hi M Walter,
    Assuming you are using Web Dynpro Java, you can change the title of the Web Page for Web Dynpro App by adding the title to the main window of your app.
    Go to Windows and open the properties. There will be a field called 'title'. Give the title you want, save, build, DC->Build and deploy.
    The title you gave to this Window will be displayed as the title of your Web page.
    Regards,
    Ajay

  • How to save a web page on a safari?

    How do I save a web page on a safari?
    didn't notice any tabs that says file > save as

    ride1992 wrote:
    You might try reading the user guide. You would be surprised at the information it offers.
    http://manuals.info.apple.com/enUS/iPad_UserGuide.pdf
    I don't believe that there is anything in the iPad User Guide about saving Web pages as Web archives which is what the original poster asked.
    With the current iPad Safari there is no way of saving web pages. Images on web pages can be saved and, of course, web pages can be bookmarked.
    To save web pages you can use another app like Goodreader. A URL in Safari can be transferred to Goodreader for downloading (add "g" before http).

  • Firefox doesn't save the web page's title as themselves!

    I want to save web pages, for example a link like below:
    http://antwrp.gsfc.nasa.gov/apod/ap080406.html
    in other browsers like Avant or Opera the web title saves as itself (for example for this link the web title save as "APOD_ 2008 April 6 - Wisps Surrounding the Horsehead Nebula" ) , but in Firefox the web title save as "ap080406" .
    I appreciate if somebody help me that ,if I can save the web title's as themselves.

    Firefox now always stores the old session which you can access by going to the History menu and selecting "Restore Previous Session".
    If you always open the last set of tabs, an alternative approach is this:
    # Click the orange Firefox button, then select options to open the options window
    # Go to the General panel
    # Change the setting "When Firefox starts" to "Show my windows and tabs from last time"

  • HT5364 Safari is not displaying the web page content & Crashes on clicking Security Tab in Preferences!

    I have Mac 10.8.4 with Safari 6.0.5.
    Safari is not displaying the web content but images on the web page are being displayed.
    Although the webpage is loaded, but nothing is shown else than Images. When I hover the mouse on the blank webpage shown, the cursor changes on the links on the web page.
    I tried resetting the preferences from the menu as well as deleting the Preferences of Safari from ~/Library/Preferences/ but nothing helped.
    When I open Preferences of Safari & click on Security tab, It Crashes!!
    Thanks,
    Shubhi

    Launch the Console application in any of the following ways:
    ☞ Enter the first few letters of its name into a Spotlight search. Select it in the results (it should be at the top.)
    ☞ In the Finder, select Go ▹ Utilities from the menu bar, or press the key combination shift-command-U. The application is in the folder that opens.
    ☞ Open LaunchPad. Click Utilities, then Console in the icon grid.
    Step 1
    Make sure the title of the Console window is All Messages. If it isn't, select All Messages from the SYSTEM LOG QUERIES menu on the left. If you don't see that menu, select
    View ▹ Show Log List
    from the menu bar.
    Enter the name of the crashed application or process in the Filter text field. Select the messages from the time of the last crash, if any. Copy them to the Clipboard (command-C). Paste into a reply to this message (command-V).
    When posting a log extract, be selective. In most cases, a few dozen lines are more than enough.
    Please do not indiscriminately dump thousands of lines from the log into this discussion.
    Important: Some private information, such as your name, may appear in the log. Anonymize before posting.
    Step 2
    Still in the Console window, look under User Diagnostic Reports for crash reports related to the process. The report name starts with the name of the crashed process, and ends with ".crash". Select the most recent report and post the entire contents — again, the text, not a screenshot. In the interest of privacy, I suggest that, before posting, you edit out the “Anonymous UUID,” a long string of letters, numbers, and dashes in the header of the report, if it’s present (it may not be.) Please don’t post shutdownStall, spin, or hang logs — they're very long and not helpful.

  • How to get the cropped page content

    Consider an A4 size pdf is cropped in Bottom and Right edges.
    If the user wants to open the pdf as A4 size then we are passing the rectangle size A4 to PDPage.DrawEx() method to get the page content.
    When we use like this, we are getting the full page content but our requirement is to get the cropped page content.
    Is there any way to get the cropped portion alone by passing the rectangle size as A4 to PDPage.DrawEx() method.
    But it is working fine for Left and Top edge cropping

    Have a look at this document:
    http://partners.adobe.com/public/developer/en/acrobat/sdk/AcroJSGuide.pdf
    go to the index and search for the term "Crop" or "Cropping" which has a hyperlink for page 70.  There you will find some JavaScript options for cropping the page from all sides which can then be saved using some other methods in the document.  I'm not sure, though, if JavaScript is what you're looking for.

  • Analysis of the Web Page Content

    Could anyone give me some tips on it?3x

    Can you expound on what you need ie what WEB PAGE CONTENT?

  • How to save the bean area content to the database

    DB version:10g
    forms version:10g
    Hi Guys,
    I have used text editor PJC/java bean in my screen where i have attched it to "bean area" field.Iam able to do all the changes to the to the text entered in this "bean area" but when i save this in the database it says no changes to save.in my table the column type is Varchar2.
    any ideas of how to save the changes of a bean area to the database???
    regards

    @François Degrelle -Ya frank i have already checked Get_Custom_Property() but the problem is this is returning the HTML code like
    html>
    <head>
    </head>
    <body>
    This is a <b>styled</b> (<i><u>HTML</u></i>) text<br><b><font color="#0066FF" face="Arial">
    displayed</font></b> and <b><font color="#008000" face="Arial">edited</font></b><br>
    in an <b><font color="#FF0000" face="Arial">Oracle Forms</font></b> application
    </body>
    </html>
    but want the data to be in the formatted so that i can store the data in the column and retrieve formatted text into the text field so that user can see only the formatted text that is lets say
    shdjshdsjdsdsdlas -original text
    shdjshdsjdsdsdlas -formatted text
    now i want to strore shdjshdsjdsdsdlas this text into teh database so that when i retrieve shdjshdsjdsdsdlas this data should be shown.
    regards
    Edited by: user123 on May 27, 2011 4:22 PM

  • Firefox won't allow me to print a Web Page. The only option I am given is to Save the Web Page as a PDF File .

    In FF 16.0.1 when I try to print a web page I get dialog box to save it as PDF. There is no other choice in the ‘save as type’ box. I do not want to save it; I just want to print it. This happens whether I use ‘file/print’ or the print button on FF. I use Win XP and HP all in one C7280 and no changes have been made recently to either. I looked for FF add- on to disable called ‘hp smart web printer’ that I read about in a closed FF support thread about this same problem but it is not on plug-in or add-on list. I also read in another closed thread on this issue to remove SWP using add/remove programs but its not listed. I believe this problem began when FF upgraded itself to 16.0.1 recently. The problem does not exist when I use I.E. or Chrome so logically it must be a FF issue. Its driving me crazy and I cannot find a solution that works anywhere. HELP please.

    Old Fox....thanks so much. I do not have the HP smart web printing in my add ons or plug ins. I used SWP in my problem posting and should have spelled out HP smart web printing..sorry.
    The NAME of the printer showed 'document converter'. WELL DUH! That was the problem all along. I have no idea how it got changed but I won't dwell on it. I have never had to look at those 'choices' because I don't need to change anything when I print but its never too late to learn.
    I am so happy and thanks again
    Terri

  • How to Preset the Web Page resolution

    Hello to all. I tried searching but came with nothing. I
    wanted to know if there is a way in preseting the page to a
    resolution, say 1024x768
    Or is it better having the width set at 100% and go from
    there?
    thank you for the help

    Hi,
    >>
    I wanted to know if there is a way in preseting the page to a
    resolution, say 1024x768
    >>
    you could put all the page contents in a table that´s
    tagged with a fixed width of 1024
    >>
    Or is it better having the width set at 100% and go from
    there?
    >>
    I´d certainly recommend this "fluid" approach, because
    you can´t foresee if the visitor has a smaller screen
    resolution, or if part of the browser´s "inner screen" has
    been reduced by means of a sidebar.

  • How to resize the web page, accidently minimised the webpage, unable to resize it.

    while surfing using my laptop, i have re sized the appearance(font size) of my gmail and facebook pages. Other web pages are ok. I'm now unable to re size it back and unable to use the site as the font size is too small and not readable.
    Appreciate any suggestion.

    Try to reset the zoom level.
    View menu > Zoom > Reset
    If you have the orange Firefox button, tap the Alt key to display the classic menu bar to get to the View menu.
    Any luck?

  • How to codify the web page

    I have some troubles when i publish the webpage because i see a lot of symbols that didn't appear when i maked de webpage, so i have codiffy the webpage with the ISO 8859-1, and i can't find the way to do that, is it possible?
    Thanks

    It would help a lot of you would provide the url.
    To change the encoding of the page would be tedious and would also get erased every time you republished.
    You may need to change the setting of your ftp program or add an .htaccess file to your space on your server. See this note:
    http://homepage.mac.com/thgewecke/iwebchars.html

  • Every time I go to a new site, I also get "How to set the home page: Firefox help. How do I stop this?

    This is a Firefox help page that I didn't request, nor do I need.

    You can use the SearchReset extension to reset some preferences to the default values.
    *https://addons.mozilla.org/firefox/addon/searchreset/
    Note that the SearchReset extension only runs once and then uninstalls automatically, so it won't show on the "Firefox > Add-ons" page (about:addons).
    If you do not keep changes after a restart or otherwise have problems with preferences, see:
    *http://kb.mozillazine.org/Preferences_not_saved

Maybe you are looking for

  • Safari 3.2.1 flawed

    It appears that Safari 3.2.1 is more flawed than the version it replaces. It continually hangs when loading sites, even apple.com does not load. This is clearly an issue with Safari as Firefox has no issues with the same sites. I have turned off the

  • Address Book on MacBook Pro does not sync with IPad or Iphone

    I have a MacBook Pro with OS10.7.4.  When I add a new address it does not sync with my IPad or IPhone.  However, adding an address on the IPad or IPhone it will appear on the IMac Pro.  I have checked to make sure that the Address Book on my IMac is

  • Set up Start Time

    Hi, I am trying to set up the start time at 0:00. I have changed the value in every possible place, restart the program and create new document. Does anyone know the way to do it? Thanks. W.

  • How do I return a device licence to my deployment pool?

    How do I return a device license to my deployment pool. I have created a package using CCP and deployed it to a test machine but now I need to return the license to my deployment pool. There is no obvious way of doing this via the deployed app or via

  • Alpha layer on V2 creates banding in the still image of V1

    I have about seventy-five shots with a still image background and an animated object above it (on video track 2). The alpha type is set correctly (black), but for some reason the background has color banding on any spot where the V2 alpha layer exist