Opening a browser to read an HTML file

I need to be able to open a browser to read an html file that I can specify. The HTML file probably, but not necessarily, reside on the same machine as the app.
I've looked through the APIs amd can't seem to figure this one out.
Any help would be appreciated.

Do you really need to open a browser, or are you just wanting to bring the text of an HTML doc into your program? If by some chance it's the latter, then that can be done pretty easily with URLConnection.getInputStream()...

Similar Messages

  • How to read an html file and replace a text using text_io

    hi,
    i want ro read an html file using text_io and replace a particular text with a new text
    eg: i want to replace a text called "data.js" and with "maps.js"
    how do i do this?

    You have to write your own code to do that. TEXT_IO is just a low level text file interface.
    You need to read in all the text, save it in some internal format (array of varchar2's maybe or in the DB) and then perform a search on the text you have read in, find out where the instances of "data.js" are located and substitute them with "maps.js" After that you need to write to a new file and delete the old one. There is no way to search and replace inside the existing file (what's sometimes referred to as 'in-place' substitution).
    See the help section called About the TEXT_IO package for an overview of how it works and some code examples.

  • Windows media player in browser asking to replace html file every time

    Hi Alll,
    I have a case in which I am running a WMP in a Browser using ActiveX container , the problem I am facing is on every run its asking me to replace the existing html file in the folder , Is there a way to get rid of that, I dnt want to click replace every time. Is there a easy way of doing this.
    Please let me know.
    Ankit
    Solved!
    Go to Solution.
    Attachments:
    wmp.JPG ‏47 KB

    Thanks, It was very helpfull
    smercurio_fc wrote:
    The dialog is being caused by the Write Characters to File VI that you are using. If the file already exists, it will ask you if you want to replace it. Instead of using those VIs, just use the Read From Text File and Write to Text File functions that are in the File I/O palette.
    Your code has another issue: your use of the Current VI Path constant. See Why Does My Executable Not Work When Using the Current VI's Path Constant?
    smercurio_fc wrote:
    The dialog is being caused by the Write Characters to File VI that you are using. If the file already exists, it will ask you if you want to replace it. Instead of using those VIs, just use the Read From Text File and Write to Text File functions that are in the File I/O palette.
    Your code has another issue: your use of the Current VI Path constant. See Why Does My Executable Not Work When Using the Current VI's Path Constant?

  • Reading in HTML file then writing to file - losing formatting.

    I am reading in a HTML file using a Buffered Reader then writing it to a file. However when i write it to a file using
    out = new PrintWriter(new BufferedWriter(new FileWriter(path, true)));
    out.write(content);
    out.flush();
    i seem to lose all carriage returns and find that the whole html is on one single line with the only noticable formatting being the spaces between the html tags.
    How can i stop it losing carriage returns?

    You only showed the part where you are writing it out.
    Does your reader code look like this:
      BufferedReader r = ...
      String content = "";
      while (true) {
        String line = r.readLine();
        if (line == null) break;
        content += line;
      }If it does, the problem lies here, as doing a readLine removes the line terminator. Soooo....
        content += line + "\n";Of course, to be most efficient and good, don't use String concatenation, use a StringBuffer (though it should be noted that when I decompiled this test code, suns compiler did indeed use a StringBuffer).
    When you print, use the PrintWriter methods print and priintln as they don't throw exceptions.

  • ??? Is it Possible to Read an HTML file in PI !!! and check a word"Failure"

    Hi All,
    My requirement is to pick an HTML file and search for a word " Failure" If its present then i need to update a particular value if not then other value.
    Regards,
    Jude

    >>My requirement is to pick an HTML file
    can be done, if html is welformed xml.
    >>and search for a word " Failure"
    if you know which tag could contain the word "failure" then i think it is possible to search in graphical mapping.
    >>If its present then i need to update a particular value if not then other value.
    you said "particular value". Is it in the target message type, if yes, then you can decide.
    I am not sure, whether your requirement and the purpose of using PI for this go together.
    thanks
    BJagdishwar.

  • Cannot read the html files

    I cannot seem to make JavaHelp find my HTML files, although it has found my Map and XML files.
    The structure is as follows:
    - the XML files are in myclasspath/doc/onlinehelp
    - the HTML files are in myclasspath/doc/onlinehelp/html
    How should I reference them from my Map.jhm file?
    Have I forgottoen any enviroment variables?
    This is really urgent
    Thanks
    Bj?rn

    The entries in your map file should take the form
    <mapID target="target_string" url="html/filename.htm" />
    so that the url includes the relative path from the directory where the xml files are.

  • Reading an html file?

    How would you go about opening a page such as http://www.google.com/ and then reading the source and passing this into a string or buffer of some sort?

    import java.util.*;
    import java.io.*;
    import java.net.*;
    public class Test
         public static void main(String[] a)
              Scanner in = new Scanner(System.in); //the command prompt inputstream
              System.out.print("Enter URL: ");
              String target = in.next(); //get the next string entered. A space is the delimiter so there can't be any spaces
              Scanner scan = null;
              try{
                   scan = new Scanner(new URL(target).openStream()); //the site's inputstream
              }catch(Exception x){
                   System.out.println("Error: site not found"); //if they didn't enter a valid URL do this
              while(scan.hasNextLine()) //while there is another line in the file
                   System.out.println(scan.nextLine()); //print that line
    }

  • Unable to update iPhone, itunes is opening a browser window looking for ipsw file

    I ran the itunes diagnostics and itunes didn't have any issues getting to the server, etc.  Uninstall and reinstalled didn't work. Machines is a Dell with Windows 7.
    Thoughts?

    I fired up my G5 MacPro and was able to update the phone, I was also then able to determine the download location for iTunes iPhone updates which is
    ~/Library/iTunes
    When I saw that I also noted that the permissions on that directory was Read/Write for System only, I added Read/Write permissions for Staff and then the download was able to happen.
    Apple needs to amend the Repair Permissions programme in Disk Utility to ensure that the above directory ( ~/Library/iTunes ) is Read/Write for Staff or users won't be able to carry out iPhone updates.
    I haven't had a chance to try the new printing features, however, my Bluetooth headset performance is dramatically improved with the iOS 4.2.1 update.

  • Xml to JTree, and JTree node to html file.

    I have been trying to figure out a way to do this and I think I have a solution, but I am not sure how to structure the application and methods.
    working with BorderLayout Panel p, JSplitPane split, JTree tree, and JEditorPane rpane
    1st. My JSplitpane is divided with the tree, and rpane. The tree is on the left, and the rpane is on the right. both of these are then added to the Panel p
    2. I will create a method that will read through a modules.xml file, and create a JTree - tree. When you click on the node element it's information is displayed in the right pane - rpane.
    The Problem. I think it would take to long to create the html file on the fly each when I click on each individual node.
    So my idea is to create the html files from many xml files when I run the program. I can then just load the html file when I click on each individual node.
    This means alot of heavy processing in the front end, and everything will be static, but it will be faster when the user is in the program.
    Problem. How do I associate each node element with the correct html file?
    The Tree elements are always the same, but I can have 1 or many modules.
    Here is an example:
    <device>  // - root
       <module1>
          <Status>
             <Network></Network>
             <Device></Device>
             <Chassis></Chassis>
             <Resources></Resources>
          </Status>
          <ProjMngt></ProjMngt>
          <ProjEdit></ProjEdit>
          <Admin>
             <admNetwork></admNetwork>
             <admUsers></admUsers>
          </Admin>
          <Logging></Logging>
       </Module1>
       ...  Now I can have 1 or many Modules depending on what the xml file  has in it.
       <Module*n>
    </device>Other problems. Some of the information I want to store as a sortable Table, but I cannot seem to get any of the sort methods to work. They work if I just open a browser, and run the html file, but if I stick the html file into the JEditorPane it does not work? - any suggestions?
    Also, can I pass a JTabbebPane to the JEditorPane, or can I create a tabbed pane in html that will do the same thing.
    I am working with a very small device. It does not have a web application container like Tomcat on it. Just Apache, and Java. That is why I am using Swing.

    Using 'productAttribute/text()' gets you all three productAttribute nodes and then grabs all the text under that node. It simply concatenates together all the text under the desired node, hence the results you are seeing. If you want to get the text for each child node separately, then you need to do something like (assumes 10.2.x.x or greater)
    WITH your_table AS (SELECT
    '<root><productAttribute>
    <name>Baiying_attr_03</name>
    <required>false</required>
    </productAttribute>
    <productAttribute>
    <name>Baiying_attr_04</name>
    <required>false</required>
    </productAttribute>
    <productAttribute>
    <name>Baiying_attr_05</name>
    <required>false</required>
    </productAttribute></root>' xmldata
    FROM DUAL)
    -- Above simulates your DB table as I don't have it
    -- You only care about the following
    SELECT xt.*
      FROM your_table yt,
           XMLTable('/root/productAttribute'
                    PASSING XMLTYPE(yt.xmldata)
                    COLUMNS
                    prd_nm   VARCHAR2(30)  PATH 'name',
                    prod_rqd VARCHAR2(5)   PATH 'required') xt;Note: I added a <root> node as you had just provided a XML fragment. You will need to adjust accordingly.
    The above produces
    PRD_NM                         PROD_RQD
    Baiying_attr_03                false
    Baiying_attr_04                false
    Baiying_attr_05                false

  • Open Local HTML file in app browser?

    Hi,
    We have a question, we would like to link to a local HTML file form within a DPS article, we need the HTML file to open up in the in-app browser; we cannot use a web content overlay for this particular feature. We are able to achieve this easily with content from an online source by creating a Go To URL link with the website in the URL section.
    Can this be done form the HTML resource folder and can this be tested in the adobe content viewer?
    Or even better can we easily link to a local folder using the Go TO URL with a local file path? If so what would this be?
    Thanks
    Daydream

    Yes, you can open an HTML file in an in-app browser by adding the HTML file to the HTMLResources.zip. Create a button with a Go To URL action that looks something like this:
    HTMLResources/HTML_Local/index.html
    Make sure that you create your HTMLResources.zip file properly and upload it to the folder. You can test this in the Adobe Content Viewer on either the iPad or the Desktop as long as you preview the folio (not the article or layout).
    Basically, you use the same technique to link to the HTML file that you use to link to PDF files. For details, see the DPS Tips app > Advanced Overlays > Linking to PDF Files.

  • Simple Browser which support locally saved html file having Marquee text

    I want simple java browser in which I can run locally saved html file having marquee text in it.
    My requirement is to show html file in Oracle forms.For that i need JAR Files of that browser which support html file(locally saved & support marque text).
    Because i use several browser which support locally html file but not support marque text.These browser display static html file not marque text in it.
    Can anybody help me.
    Regards

    1. There is no reliable way of guessing the encoding of a file without that information. Thats why XML for example has very strict rules wrt. it's encoding (short form: use UTF-8 or UTF-16, if you use anything else, you'll have to specify it)
    2. you might be able to make an educated guess if the possible range of encodings is limited, but it will probably never be 100% certain
    3. The HTML file might have a header entry "<meta http-equiv..." that tells you about it's encoding. You could try to read the start of the file and see if you find that, then if you found it re-read the entire file.
    regards

  • When I try to open the HTML file "file:///C:/Users/DHeimann/Documents/JP Cohousing/Retreat agenda 2014.htm", the system attempts to access Gmail and hangs.

    I can open various most other *.htm or *.html files on my C drive without a problem. However, there are other HTML files on the drive that do have this problem when I try to open them.
    When I try to open the file in Internet Explorer rather than Firefox, I get a message that JavaScript is not enabled. However, I do have JavaScript enabled, and have just updated Java to Version 7, Update 51.

    One of the problems with saving web pages from complex dynamic sites like Gmail is that you may be saving the instructions for rendering the page rather than the actual content of the page. In that case, if you are logged out of your account or there is a cross-site security bar to pulling the needed data, then the saved page may not display correctly or at all. If a message is critical, it's a good idea to print or save the page to PDF or grab a screen shot to work around that problem.
    The message you're getting in Internet Explorer may be related to the fact that IE has different security zones with different restrictions. For example, sites in the Internet Zone normally can run JavaScript, and sites in the Restricted Sites list cannot. The local computer zone has much tighter security compared with the old IE6/XP days, and that may explain what you're seeing there.
    P.S. Browsers interpret JavaScript internally without using the Java plugin.

  • Reading HTML files in a java

    Hi guys,
    In a project that I have to submit, I have to read a HTML file's text and then have to check if it contains any word or words, that are present in a List.
    I already have the list, But how can I read the HTML file and then how can I compare it's text...
    any idea please...any kind of help is appreciated

    [http://forums.sun.com/thread.jspa?threadID=5115338&messageID=9394434]

  • To read HTML files

    Hi all,
    I have got the following coding. From this coding, i will read some HTML pages in a folder named Content. I will only need to read the HTML files and not any other files. How can i achieve this? Meaning what coding do i have to add in my coding to tell it to read the HTML files only.
    This is the coding i have:
    public class Copy
         public static void main(String[] args) throws IOException
              processDir(new File("../Content"));
         static void processDir(File path) throws IOException
              System.out.println("path " + path.getAbsolutePath());
              File[] files = path.listFiles();
              if(files == null)
              return;
              for (int a = 0; a < files.length; a++)
              if (files[a].isDirectory())
                   processDir(files[a]);
              else
                   BufferedReader in = new BufferedReader(new FileReader(files[a]));
         StringBuffer sb = new StringBuffer();
         String str;
         while ((str = in.readLine()) != null) {
         sb.append(str);
         in.close();
              //System.out.println(sb.toString());
    Hope you guys can help me.
    Thanks!
    Peifeng

    Groan go here http://sourceforge.net/projects/ambient/, get the package... Look at SystemFiles.CoreFiles.LoadAllIOContexts line 152, you will find your answer there....

  • Launching html file from JFrame

    I wish to launch an html file called "Help.html" when a user clicks on the help button on my toolbar in the GUI. I know how to open a simple program using the Runtime.exec( ) command but the problem is how would i open a specified file in a specified program...any help will be appreciated.
    PS: I do not know any C unfortunately, haven't done that yet at uni but would be glad to learn now :)

    I think you missed the question, opening a simple JFrame with a JTextArea won't have the same effect of opening a HTML file in which user can click on stuff and all that, even if I do open another JFrame imagine all the programming i have to do to get the URL's working for all the links in the help file and little search commands etc...I hope someone can tell me how to open the clients web-browser with the help.html file supplied by me!

Maybe you are looking for

  • Several applications including Settings open and close immediately, unable to get iTunes to install an update

    While traveling in China, I was unable to get latest iTunes download an update to 4.3.2  (after download is compoleted, is starts processing and says network timed out, without any clear reason) I can download the file separately for an older version

  • How can I know which model of K9A2VM I have?

    I have a K9A2VM motherboard with an Athlon 64 x2 3600+ AM2 CPU. I would now like to upgrade to an AM3 Phenom II CPU with lots and lots of cores. However, I have a problem. I don't know if I have K9A2VM-FD or K9A2VM-FIH and I don't know how to find ou

  • Banking Reports not accessible by Lim. Financial License in SAP B1 8.81 PL 0

    Dear All, I am using SAP B1 8.81 PL 00 (Indian localization). When I log in with a Limited Financial License user , the Banking Reports cannot be accessed. It gives a message : 'You cannot open window with your current license'. Also I cannot locate

  • InDesign Script question

    We had InDesign CS2 and updated to CS5 last fall and rewrote many of our scripts. About a month ago we updated to MS Office 2010. When we try to run our scripts on text copied out of Windows 2010 it seems like the script isn't catching the same thing

  • How To Install Razor

    I have noticed that there is a lot of interest but no real posting on how to install Razor2 on OS X Server (10.4). After a little searching, I found a couple of excellent sources. The primary source of info is the following URL: http://greg.agiletort