How to save HTML

i need to know how to save an HTML file of a visited website being entered
from a textField. I want it to be able to save the picture files as well..
as an example when u key in http://www.yahoo.com i gets the HTML files and
and the WHOLE image files contains in http://www.yahoo.com and save it to a certain directory. Just like when u visited a website and u click save as in IE, u can get the HTML files and all the image files from the website.
thx..

alright.. so this is the portion of my code.. i am suppose to download the image to a certain folder.. but so far it can only extract the HTML content to a textArea i provided. and the temp.indexOf("extension") does not work in my program.. but i works in my friends program.. pls tell me what went wrong.. and how to save the whole image files into a certain folder.
try
String strimg, temp;
     a=0;
     b=a+5;
                                   htmlArea.setText("");
                                   cmbimg.removeAllItems();
                                   connectionArea.append("* Processing request by "+s.getInetAddress().getHostAddress()+" to "+msg+" ......");
                                   URL url=new URL(msg); // value taken from client request
                                   BufferedReader in=new BufferedReader(new InputStreamReader(url.openStream()));
// this is the portion that extract the HTML files
                                   do
                                        temp=in.readLine();
                                        if (temp.indexOf("jpg")>1 || temp.indexOf("gif")>1 || temp.indexOf("JPG")>1 || temp.indexOf("GIF")>1)
                                             //Assigning 'a' a Value.
                                             if( temp.indexOf("src")>1 || temp.indexOf("SRC")>1 )
                                                  if( temp.indexOf("src")>1)
                                                       a=temp.indexOf("src");
                                                  else
                                                       a=temp.indexOf("SRC");
                                             //Assigning 'b' a Value.
                                             if ( temp.indexOf("jpg")>1 )
                                                  b=temp.indexOf("jpg");
                                             //Assigning 'b' a Value.
                                             else if (temp.indexOf("gif")>1)
                                                  b=temp.indexOf("gif");
                                             //Assigning 'b' a Value.
                                             else if ( temp.indexOf("JPG")>1 )
                                                  b=temp.indexOf("JPG");
                                             //Assigning 'b' a Value.
                                             else if (temp.indexOf("GIF")>1)
                                                  b=temp.indexOf("GIF");
                                             strimg=temp.substring(a+5,b+3);
                                             cmbimg.addItem(strimg); //cmbing is a JCombobox
                                        //EXRTRACT IMAGES FROM SITE
                                        strimg=temp.substring(a+5,b+3);
                                        cmbimg.addItem(strimg);
                                        if (temp.equals(null))
                                             temp="";
                                        htmlArea.setText(htmlArea.getText() + "\n" + temp); //htmlArea is the text area to display the extracted HTML content
                                   }while(!temp.equals(null));
                              catch(java.net.ConnectException eNet){
                                   System.out.println("Connection Failed....");
                              catch(NullPointerException e){
                              catch(MalformedURLException eNet1){
                                   connectionArea.append("\n* "+msg+" is an Invalid Address");
                                   count = 1;
                              catch(Exception e){
                                   connectionArea.append("\n* Unable to Connect to: "+msg+"\n");
                                   count = 1;
                              }

Similar Messages

  • How to save html as Excel file im java

    Hi to all
    How can i save html file as Excel file in Java
    If any solutions plz help Me

    Thanks for ur reply
    Source URL is::http://www.sttpc.com/reseller/price.htm
    Target is to save table data into Excel Sheet.
    Upto saving that file as Excel file its working (using I/O).
    When iam trying to read excel sheet data then iam getting OLE Exception.
    plz suggest me other Alternate solutions to overcome this problem.
    I tried htmlparser from sourceforge.net i got partial ouput.But i want dynamic solution.
    Thanks.

  • How to save html response when execute a siebel load test.

    First at all excusme for my english.
    I need help to manage html response. I use OpenScript Version: 9.3.1.0 Production.
    When i execute a siebel load test, some of the VU returns the error "12152 the server response could not be parsed". Mi boss asked me an image or html response to analize the error. But i dont now how to get it.
    I search in all logs but i didn´t find nothing usefull.
    Anyone know how to save the html response when execute a load test?
    Thanks.
    Gabriel.

    "First at all excusme for my english."
    => are you french? I am! So no problem of course ;-)
    Which ATS version do you use? Because starting with 12.1, you have a better VU Logging capabilities.
    From the OLT user guide:
    The virtual user logs window has the following toolbar options:
    Open - Opens an existing virtual user log.
    Save as CSV - Exports the current VU log to a comma-separated value file.
    Clear - Clears the virtual user logs.
    View Text - Displays the source HTML for pages accessed by the virtual user.
    Render HTML - Displays actual pages as accessed by the virtual user.
    Auto Display - Displays pages as they are received by the viewer.
    See if it can help.
    If not, maybe you could implement some logics in OpenScript, but i wouldn' advice that.
    JB

  • How to save HTML file with images present in the server to local machine

    Hi all
    In my application i have a option for the user to save HTML files with images present in the server. The HTML file is getting saved but the images are not being saved.
    The code i am using is below :-
    l
                        File fname = new File(filePath);
                        if(!fname.exists())                return;
                        FileInputStream istr = null;
                        OutputStream ostr = null;
                        response.setContentType("application/"+format);
                        response.setHeader("Content-Disposition", "attachment; filename=\"" + fname.getName() + "\";");
                        try { 
                             istr = new FileInputStream(fname);
                             ostr = response.getOutputStream();
                             int curByte=-1;
                             while( (curByte=istr.read()) !=-1)
                                  ostr.write(curByte);
                             ostr.flush();
    Can anyone suggest what i need to do
    regards

    The client should probably parse the html that comes down, and look for <img> links, and request those of the server as well.

  • How to save .html page in iBooks on iPad

    I'm on my works intranet site that holds all of our policies and procedures. The links to each specific policy open has .html and not a PDF ( which it does or at least did at one point on my partners ipad that was running an older software version). How can I take that that page ( that specific policy or procedure) and save it in iBooks on my iPad?
    Thank you

    Sinjin2157 wrote:
    What are and where can I download widgets on my ipad?
    That poster seems to be referring to a technique used for adding webpages to ebooks created by using the iBooks Author app.  I think he misread your question and thought he was in the forum for iBooks Author instead of this one.
    You can't do anything with widgets on your iPad.

  • How to Save HTML page in Apex application into our local Windows Box

    Hi,
    I am having one HTML page in my Apex Application. I want to download this page into my Local Windows machine. How to do this?
    Thanks
    Yash

    I am having one HTML page in my Apex ApplicationWhat did you mean by this ?
    <li> If you meant an application page, then they are anot stored as html file anywhere as the page that you see is generated at the run time only, however you can can save that run time page , but its of not much use.
    <li> If your intention is to save/backup an apex page, go to the page and export it . This generates a SQL file which you can import into any other apex application and recreate that apex page.
    <li> You can also export the entire application as a single file too.

  • How to save html code  into a html file in webdynpro

    Hello Everyone!
    I want create a html page in WebDynpro,
    example :
    String mystr = "<html><head><titile>This is a text</title></head><body> this is body</body></html>";
    I want create a html page and save this to the *.html page , how can i to do ?
    thanks!

    HI! sowmya&Satya
    1st:
    I use method (File>new>file.) create a html under my project . but when I swith web dynpro perspective,  can't found the html file under my current project ?
    2nd:
      public void onActionInputToHtml(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
        //@@begin onActionInputToHtml(ServerEvent)
        String mystr = "<html>.............</html>"
        //@@end
    how to input "mystr" to the html page which I have create in 1st step ?
    3rd :
    how to display the html page In IE when run my project program ?
    Thanks!

  • How do I download and saves html files off my website to store and save using Dreamweaver CS3?

    How do I download and saves html files off my website to store and save using Dreamweaver CS3?
    I need to save all files from web and store onto a drive to reupload to a new domain name.  I use Dreamweaver CS3.

    First define your Local Site folder in Dreamweaver.  DW will use this folder to store your site files.
    Go to Manage Sites > New or Edit site.  See screenshots.
    Servers:  Enter your remote server's log-in details.  When complete, hit TEST to see if the connection is working.  If all is well, hit SAVE.
    From the Files Panel (F8), click on Remote Server to show the files that are currently there.  Click the green Down Arrow to GET files from remote server to your local site folder.
    Nancy O.

  • How to save diagramm in HTML format or PDF it

    how to save diagramm in HTML format or PDF it

    You have two alternatives. First of all, there are many utilities, some of them free that can put a "printer" on your printer list that really writes a PDF file. The one I use is free, called CutePDF. Once you have one of these installed, saving to PDF is as simple as print the diagram, choose the printer associated with your utility, then name the file.
    I'm not sure if it is in your version of Designer, but all of the latest versions of Designer have a "publish diagram" utility. Just drop down the Utilities menu from the RON or the Design Editor. The bottom selection should be "Publish Diagrams...", which will open a dialog window. Choose the diagram(s) you want to publish, select Publish to File, enter a file name, and select a graphics format from PNG, GIF, JPEG, BMP or TIFF. You can easily add the file to an HTML page inside an &lt;IMG&gt; tag.

  • How to save JList items!

    hello,
    i m creating a class that has three JList components.
    My problem is how to save the each JList items into a seperate logfile(ie. text file).

    More info required:
    What are in the JList? Strings? Custom objects?
    Do you know basic file IO?
    http://java.sun.com/docs/books/tutorial/essential/io/index.html
    What you will need to do is get the model, ilterate over each element, then write that element out. If the element is a string, then that is easy, just create a FileWriter, and write the string, followed by a new line.
    If it is a custom object, then the task is harder, and you need to decide how that object should be represented.
    If you are after a computer readable view of the model, rather than a human readable, which can easily be read by Java back into a ListModel, then you want to look at XMLEncoder and XMLDecode, or the Serializing Objects tutorial.
    http://java.sun.com/docs/books/tutorial/uiswing/components/list.html

  • I want to use Get Panel Image in Labview 5.0.1 and need details on how to save the BMP data generated

    I am trying to generate an application that saves a copy of its front panel on completion. This is easy to do using an invoke node with Print VI to HTML but this does not work in an .exe format. I have seen elsewhere that you have to use the Get Panel Image method, but no details are supplied in LV 5.0.1 documentation of how to use the "image" data (1-D Unsigned Byte array) that is generated. I want to save this in a format that can then be read as a bitmap in any standard graphics package. Any assistance?

    Hi,
    If you'd upgrade to LV5.1 or 6 you could use the 'standard' vi's for this.
    You need a VI called "Write BMP File.vi". It's not shipped with LV5.0.1.
    This vi only uses 3 subVI's, so perhaps someone at NI can convert it and
    send it to you (sorry, I won't, it's copywrited).
    If you cannot get this VI anywhere, you'll need to figure out the BMP file
    format yourself. It's not too complicated, but still could take some days.
    Perhaps someone figured it out before LV5.1 was released.
    Regards,
    Wiebe.
    "RDK" wrote in message
    news:[email protected]..
    > I want to use Get Panel Image in Labview 5.0.1 and need details on how
    > to save the BMP data generated
    >
    > I am trying to generate an application that saves a copy
    of its front
    > panel on completion. This is easy to do using an invoke node with
    > Print VI to HTML but this does not work in an .exe format. I have seen
    > elsewhere that you have to use the Get Panel Image method, but no
    > details are supplied in LV 5.0.1 documentation of how to use the
    > "image" data (1-D Unsigned Byte array) that is generated. I want to
    > save this in a format that can then be read as a bitmap in any
    > standard graphics package. Any assistance?

  • How to save info in a meta-data of a jpg file?

    hi, i need to know how to save info in a meta-data of a jpg file:
    this is my code (doesn't work):
    i get an exception,
    javax.imageio.metadata.IIOInvalidTreeException: JPEGvariety and markerSequence nodes must be present
    at com.sun.imageio.plugins.jpeg.JPEGMetadata.mergeNativeTree(JPEGMetadata.java:1088)
    at com.sun.imageio.plugins.jpeg.JPEGMetadata.mergeTree(JPEGMetadata.java:1061)
    at playaround.IIOMetaDataWriter.run(IIOMetaDataWriter.java:59)
    at playaround.Main.main(Main.java:14)
    package playaround;
    import java.io.*;
    import java.util.Iterator;
    import java.util.Locale;
    import javax.imageio.*;
    import javax.imageio.metadata.IIOMetadata;
    import javax.imageio.metadata.IIOMetadataNode;
    import javax.imageio.plugins.jpeg.JPEGImageWriteParam;
    import javax.imageio.stream.*;
    import org.w3c.dom.*;
    public class IIOMetaDataWriter {
    public static void run(String[] args) throws IOException{
    try {
    File f = new File("C:/images.jpg");
    ImageInputStream ios = ImageIO.createImageInputStream(f);
    Iterator readers = ImageIO.getImageReaders(ios);
    ImageReader reader = (ImageReader) readers.next();
    reader.setInput(ImageIO.createImageInputStream(f));
    ImageWriter writer = ImageIO.getImageWriter(reader);
    writer.setOutput(ImageIO.createImageOutputStream(f));
    JPEGImageWriteParam param = new JPEGImageWriteParam(Locale.getDefault());
    IIOMetadata metaData = writer.getDefaultStreamMetadata(param);
    String MetadataFormatName = metaData.getNativeMetadataFormatName();
    IIOMetadataNode root = (IIOMetadataNode)metaData.getAsTree(MetadataFormatName);
    IIOMetadataNode markerSequence = getChildNode(root, "markerSequence");
    if (markerSequence == null) {
    markerSequence = new IIOMetadataNode("JPEGvariety");
    root.appendChild(markerSequence);
    IIOMetadataNode jv = getChildNode(root, "JPEGvariety");
    if (jv == null) {
    jv = new IIOMetadataNode("JPEGvariety");
    root.appendChild(jv);
    IIOMetadataNode child = getChildNode(jv, "myNode");
    if (child == null) {
    child = new IIOMetadataNode("myNode");
    jv.appendChild(child);
    child.setAttribute("myAttName", "myAttValue");
    metaData.mergeTree(MetadataFormatName, root);
    catch (Throwable t){
    t.printStackTrace();
    protected static IIOMetadataNode getChildNode(Node n, String name) {
    NodeList nodes = n.getChildNodes();
    for (int i = 0; i < nodes.getLength(); i++) {
    Node child = nodes.item(i);
    if (name.equals(child.getNodeName())) {
    return (IIOMetadataNode)child;
    return null;
    static void displayMetadata(Node node, int level) {
    indent(level); // emit open tag
    System.out.print("<" + node.getNodeName());
    NamedNodeMap map = node.getAttributes();
    if (map != null) { // print attribute values
    int length = map.getLength();
    for (int i = 0; i < length; i++) {
    Node attr = map.item(i);
    System.out.print(" " + attr.getNodeName() +
    "=\"" + attr.getNodeValue() + "\"");
    Node child = node.getFirstChild();
    if (child != null) {
    System.out.println(">"); // close current tag
    while (child != null) { // emit child tags recursively
    displayMetadata(child, level + 1);
    child = child.getNextSibling();
    indent(level); // emit close tag
    System.out.println("</" + node.getNodeName() + ">");
    } else {
    System.out.println("/>");
    static void indent(int level) {
    for (int i = 0; i < level; i++) {
    System.out.print(" ");
    }

    Hi,
    Yes, you need store data to table, and fetch it when page is opened.
    Simple way is create table with few columns and e.g. with CLOB column and then create form based on that table.
    Then modify item types as you like, e.g. use HTML editor for CLOB column
    Regards,
    Jari

  • How to save a value in form jsp?

    hi all,
    i have a dropdown list in my struts web app,
    i am having a form in which a bean is instatiated(bean has 2 properties "name" and "code").
    i am using like this in the jsp:
    <td><html:select property="item.code">
                             <logic:iterate id="itemType"
                                  name="<%=WebConstants.getItemTypeListName()%>">
                                  <option value='<bean:write name="ItemType" property="code"/>'><bean:write
                                       name="ItemType" property="name" /></option>                              
                             </logic:iterate>                         
                        </html:select></td>
    each "itemType" has "code" and "name".
    when the user clicks on the item name on the dropdown item beans "code" is populating.now i need to populate "name" aswell at the sametime using hidden property.
    i want to save tha value of name in the jsp to use it later to populate "name" in my form using hidden property?
    do anyone have idea how to save the value in jsp?
    regards and thanks in advance

    Thank you. I execute the program below. I can now retrive the data from the Lt.txt. But the value is limited to 3 digits. For example, the content of my file is 777888.
    When I run the program, I only get 777. How can I retrive the whole exact number?               
    import java.io.*;
                   class Test {     
                   public static void main(String args[]) {          
                   try {               
                   File inputFile = new File("Lt.txt");               
                   File outputFile = new File("outagain.txt");                    
                   FileReader in = new FileReader("Lt.txt");               
                   FileWriter out = new FileWriter(outputFile);               
                   char[] tmp = new char[3];               
                   int cnt = in.read(tmp);                              
                   System.out.print("\nRead: ");               
                   for (int i = 0; i < cnt; i++) {                    
                   System.out.print(tmp);               }               
                   System.out.println(" ");               
                   in.close();          }
                   catch (IOException ex) {               
                   System.out.println("IOException:"+ex.toString());          }     }}

  • Is this right way ro save html file as excel file

    Hi all
    Iam saving html page as excel page .Source code for this is
    BufferedWriter out = new BufferedWriter(new FileWriter("c:/Excel/price.xls"));
    BufferedReader in = new BufferedReader(new FileReader("C:/html/price.htm"));
    String str;
    while ((str = in.readLine()) != null)
    out.write(str);
    in.close();
    out.close();
    Is above procedure is right to save html page as excel page
    IAm using JExcelAPI for re-writing excel sheet .
    When iam accesing price.xls file iam getting following Exception
    ---------- Run Java ----------
    jxl.read.biff.BiffException: Unable to recognize OLE stream
    How to solve it?
    Is any methods required to set EXCel sheet in java?
    Can we use other API for solving it
    IF any plz suggest me.
    What is diff b/w Jexcel And Apache POI?
    Reply me soon
    MAdhuram

    Thanks for ur reply
    Basically that html file is Excel file only
    For view purpose saved it as html b'coz it is using in site(This part is mainetainied By US )
    I need to download that file from site(Iam from India)
    extract some data from that For that pupose i tried with htmlparser but it is not sovling problem completely.For that purpose i moved towards JExcelAPI .
    Manually i saved it as .excel file then it is accessible with JExcel API
    If i follow procedural way ie above method then its saving as excel file and looking as Excel file but when iam accesing that file as Excel file then it is giving Exception isOLEException
    If i access manually convereted file then it is accessible.
    Iam sending source URL
    Look at this ::http://www.sttpc.com/reseller/price.htm
    Procedural Code As Follows:
    BufferedWriter out = new BufferedWriter(new FileWriter("c:/Excel/price.xls"));
    BufferedReader in = new BufferedReader(new FileReader("C:/html/price.htm"));
    String str;int c=0,r=0;
    while ((str = in.readLine()) != null)
    out.write(str);
    n.close();
    out.close();
    Sorry For my English

  • How to save a .csv file to database server

    Hi every body,
    I need to upload a .csv file from the client machine and save it to a directory in a database sever.
    I could do the uploading part. Can anyone tell me how to save the file?
    Another option is save the file as a CLOB in a database column. But I'm not aware of doing that too.
    Please guide me.
    Thanks in advance.
    Surangi.

    See Steve Muench's Not Yet Documented Example #85 at http://radio.weblogs.com/0118231/stories/2004/09/23/notYetDocumentedAdfSampleApplications.html#85. While this is for 10.1.3, this is still relevant for 11g. Steve's example is for uploading to a BLOB - same thing for a CLOB. Once your data is in the database, you can use the DBMS_LOB package to write the file to a directory on the database server, if you like.
    Also the Developers Guide is your friend - Chapter 9.9 in the Fusion Web User Interface Developers Guide for Oracle ADF 11g, or 19.6 in the ADF Developers Guide for Forms/4GL Developers for JDeveloper 10.1.3.

Maybe you are looking for

  • How can I detect a dialog and respond?

    I'm having trouble doing something that's probably not that hard. I'm trying to "Print to PDF" a bunch of old AppleWorks documents. When you open a document created in AppleWorks v6 it opens right up, but when you open a document created in AppleWork

  • System preferences - Network

    hi, when ever i want to change something in the system preferences area, such as adding a wireless network to my list. when i clcik apply, it just hangs, i get the lollypop, and i have to force quit it after a while. it always has been doing that for

  • Virtual column based partitioning

    Hi, we have a non-partitioned table in a production database and wish to partition it based on an expression. Since we are on 11.2 the first thing that comes to mind is virtual column based partitioning. The "problem" is that in order to partition by

  • What is the process flow for Asset Acquisation without PO in CIN environmen

    Hi, I need to do Asset Acquisation without PO (Directly through F-91) scenario in CIN environment. Kindly help me on *how to proceed with Direct Asset Acquisation without PO. How can i capture excise invoice for this scenario. When i am doing direct

  • How to create raised paths?

    I have CS2. Let's say that I have a complex path (not just a circle or square but really funky). What I want is for Illustrator to make a 3D shape out of that and the shape should be kind of similar to how a cookie rises in the oven. For instance, so