Possible to read data from a web browser into java?

Is it possible to read data from a web browser such as IE or Mozilla into a java applet for use and manipulation? If it is, could someone please post some documentation I could look at or a snip-it of code I could use? Thanks.

This will read the content from a site:
import java.net.*;
import java.io.*;
class Test {
     public static void main(String[] argv) throws Exception {
          URL u = new URL("http://www.google.com");
          URLConnection uc = u.openConnection();
          BufferedReader br = new BufferedReader(new InputStreamReader(uc.getInputStream()));
          String text;
          while( (text = br.readLine()) != null ) {
               System.out.println(text);
}

Similar Messages

  • How do I add dates from a web page into iCal?

    Hello. I would love to find a way to input dates from a web page, into iCal as an event. Right now, if there is a conference or whatever that is on such and such a date, I have to keep the web page open that has the dates and time, and then open iCal, and create a new event on that date, etc. Is there a way to highlight said dates on a web page, run some automation, and voila, it is a new event in iCal?

    Don't double tap. Just try pressing on the text. That should highlight it.

  • How to read data from an internal table into a real table?

    Hello experts,
    I'm relatively new to ABAP and I'm trying to figure out how to read data from an internal table into a table that I created.  I'm trying to use the RRW3_GET_QUERY_VIEW_DATA function module to read data from a multiprovider.  I'm trying to read data from the e_cell_data and e_axis_data tables into a table that I've already created.  Please see code below.
    TABLES MULTITAB.
    DATA:
      query_name TYPE RSZCOMPID,
      s_cubename TYPE RSINFOPROV,
      t_cell_data TYPE RRWS_T_CELL,
      t_axis_data TYPE RRWS_THX_AXIS_DATA,
      t_axis_info TYPE RRWS_THX_AXIS_INFO,
      wa_t_cell_data like line of t_cell_data,
      wa_t_axis_data like line of t_axis_data,
      w_corp_tab like line of t_cell_data.
    s_cubename = 'CORP_MPO1'.
    query_name = 'Z_corp_test'.
        CALL FUNCTION 'RRW3_GET_QUERY_VIEW_DATA'
           EXPORTING
             i_infoprovider           = s_cubename
             i_query                  = query_name
            i_t_parameter            = query_string_tab
           IMPORTING
             e_cell_data              = t_cell_data
             e_axis_data              = t_axis_data
             e_axis_info              = t_axis_info.
    If anyone has any information to help me, I would greatly appreciate it.  Thanks.

    Hi,
    <li>Once you call the function module RRW3_GET_QUERY_VIEW_DATA, lets say data is available in the corresponding tables e_cell_data e_axis_data which you have mentioned.
    <li>Modify your internal table defined for other purpose, with data from e_cell_data e_axis_data like below.
    LOOP AT t_cell_data INTO wa_t_cell_data.
      "Get the required data from t_cell_data.
      MOVE-CORRESPONDING wa_t_cell_data TO it_ur_tab.
      "Modify your internal table wih data
      MODIFY it_ur_tab TRANSPORTING <field1> <field2> <field3>.
    ENDLOOP.
    LOOP AT t_axis_data INTO wa_t_axis_data.
      "Get the required data from t_cell_data.
      MOVE-CORRESPONDING wa_t_axis_data TO it_ur_tab.
      "Modify your internal table wih data
      MODIFY it_ur_tab TRANSPORTING <field1> <field2> <field3>.
    ENDLOOP.
    Thanks
    Venkat.O

  • Read data from Excel and write into oracle database

    Hi
    I want  to know how can i read data from excel and write into oracle database using java.Kindly help me out to find a solution.
    Thanks and Regards
    Neeta

    Hai,
    I am suggesting the solution.
    I will try out and let u know soon.
    Make a coma separated file from your excel file.
    Assuming that your requirement allows to make a csv file.
    This file may be passed as an file object to be read by java.Using JDBC you must be able to populate the data base.You can also use String Tokenizer if needed.
    You do not want to  go via sql Loader?
    For reading the excel file itself do you want java?

  • Reading data from App Web List and Displaying in HostWeb.

    Hi,
    Is it possible to read list data from AppWeb and display it on a page in HostWeb?
    Any approaches to achieve this?
    Regards,
    Rivin Jose.

    Hi Rivin,
    There seems no need to query an app web from host web cause App for SharePoint is designed to work as an “advanced web part” solution, it should work as a separate
    component of a SharePoint site which shouldn’t be taken care on the host web side.
    If you simply want to display data from app web in the host web, add an App Part into a page in the host web would be the best option for you as what Dan suggests.
    Thanks         
    Patrick Liang
    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]

  • How to read data from Analysis web Item.

    Hi,
    We are currently on BI 7 SP 16 Java 16,
    I am trying to present data from 10 reports on to one single page, so for that i want to read data from the Analysis item, and present it on one page.
    How do i read data and write it on to a page, i know we have to use java script for this , but i am not sure how to use the script. Can any one please help me on how to write the code if possible please give me the code or any suggestions.
    Appreciate your help in advance.
    Kumar

    Hello,
    May the Report Designer can help you on this:
    http://help.sap.com/saphelp_nw70/helpdata/EN/dd/cea14119eb9f09e10000000a155106/frameset.htm
    Best Regards,
    Ricardo

  • Get xml data from a web service into Forms?

    Hello folks! I am reading active directory info from a web service into forms via imported java classes. I can read from functions that return strings just fine, but I have to get the output from getGroupUsers which returns an XmlDataDocument. How do I read this in and parse it in Forms?
    I will be grateful if y'all could point me to an example.
    Thank you,
    Gary
    P.S. Here is a snippet of how I get the full name by passing an ID:
    DECLARE
    jo ora_java.jobject;
    rv varchar2(100);
    BEGIN
    jo := ADSoapClient.new;
    rv := ADSoapClient.getUserName(jo, 'user_ID');
    :block3.fullname := rv;

    Hello,
    Since you are already dealing with server-side JAVA, I would suggest you create a method that would do the parsing server-side and what your PL/SQL will be dealing with is just the return string.
    Here is a method I use to read an XML file (actually, it is an Oracle Reports file converted to XML) and from the string version, I will do search, replace and other things.
    So, from getGroupUsers which returns an XmlDataDocument, you can adapt this method to get your data server-side and let the form module read the output data.
    <blockquote>
    private String processFileXml(String fileName, int iFile) throws ParserConfigurationException, SAXException,
    IOException, XPathExpressionException{
    try{                
    DocumentBuilderFactory domFactory = DocumentBuilderFactory.newInstance();
    domFactory.setNamespaceAware(true);
    InputStream inputStream = new FileInputStream(new File(fileName));
    DocumentBuilder builder = domFactory.newDocumentBuilder();
    Document doc = builder.parse(inputStream);
    StringWriter stw = new StringWriter();
    Transformer serializer = TransformerFactory.newInstance().newTransformer();
    serializer.transform(new DOMSource(doc), new StreamResult(stw));
    return stw.toString();
    catch (Exception e){
    System.err.println(e);
    System.exit(0);
    return "OK";
    </blockquote>
    Let me know if this is of nay help.
    Thanks.

  • Auto-Copying data from a web browser

    Well i am in the middle of a self-project and i was wondering if there was any way :
    Lets say i open the browser at a specific web page , the web page URL will be read ( i think i now how to do this ) and if it matches to the one that i want
    it will copy some data from different positions that i will set into some text fields and then be stored automatically !
    if this can be done , please direct me somwhere to read and find out , or anything that would help me in finishing this one !
    thnx in adnvace
    stevoo

    If the webpage has to be shown, I've used JDIC WebBrowser, and used its executeScript. with stuff like myObject.value="boo"; to do this. It worked quite well.
    If it does not, use URL and build the URL.

  • How do you read data from a text file into a JTextArea?

    I'm working on a blogging program and I need to add data from a text file named messages.txt into a JTextArea named messages. How do I go about doing this?

    Student_Coder wrote:
    1) Read the file messages.txt into a String
    2) Initialize messages with the String as the textSwing text components are designed to use Unix-style linefeeds (\n) as line separators. If the text file happens to use a different style, like DOS's carriage-return+linefeed (\r\n), it needs to be converted. The read() method does that, and it saves the info about the line separator style in the Document so the write() method can re-convert it.
    lethalwire wrote:
    They have 2 different ways of importing documents in this link:
    http://java.sun.com/docs/books/tutorial/uiswing/components/editorpane.html
    Neither of those methods applies to JTextAreas.

  • Quick way to format text cut and pasted from a web browser into Pages?

    I work a lot by cutting and pasting text from web browsers into my word processor.
    When I was using Word, I had built a very useful macro that allowed me to re-format the font, font size, colour, line spacing etc, as well as to remove hyperlinks, all by pressing one keyboard shortcut.
    Is this possible in Pages? I've tried Paste and Match Style, and Paste Paragraph Style, but they only seem to solve half the problems.
    Surely this must be a common problem? I've had a look in the discussion forums, but can't find anything...

    arthur,
    I'm not having any trouble deleting links. Click on View > Show Invisibles. If there's a space following the link, put your cursor to the right side of the space, click, then drag to the left so that you highlight the link. Then just hit delete.
    Or, if you want to have a web or email address in your copy without it being a live link, highlight it, then click on the Link inspector > Hyperlink button > and UNcheck +Enable As Hyperlink+.
    -Dennis

  • How to read data from Linux named pipes using java?

    In linux box I want to get data from a named pipe(created using "mkfifo <filename>".
    How I can read the incoming data from the named pipe?

    there are some caveats though: if i remember correctly, when you reach the end of data in a fifo it will look like end-of-file and that may confuse some classes. So your mileage may vary

  • How to read data from the excel file using java code.

    Hi to all,
    I am using below code to getting the data from the excel file but I can't get the corresponding data from the specific file. can anyone give me the correct code to do that... I will waiting for your usefull reply......
    advance thanks....
    import java.io.*;
    import java.sql.*;
        public class sample{
                 public static void main(String[] args){
                      Connection connection = null;
                          try{
                               Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
                               Connection con = DriverManager.getConnection( "jdbc:odbc:Mydsn","","" );
                               Statement st = con.createStatement();
                               ResultSet rs = st.executeQuery( "Select * from [Sheet1$]" );
                               System.out.println("sample:"+rs);
                                  ResultSetMetaData rsmd = rs.getMetaData();
                                  System.out.println("samplersd:"+rsmd);
                               int numberOfColumns = rsmd.getColumnCount();
                                  System.out.println("numberOfColumns:"+numberOfColumns);
                                   while (rs.next()) {
                                            System.out.println("sample1:"+rs);
                                            for (int i = 1; i <= numberOfColumns; i++) {
                                                 if (i > 1) System.out.print(", ");
                                                 String columnValue = rs.getString(i);
                                                 System.out.print(columnValue);
                                            System.out.println("");
                                       st.close();
                                       con.close();
                                      } catch(Exception ex) {
                                           System.err.print("Exception: ");
                                           System.err.println(ex.getMessage());
                        }

    1: What is the name of the excel sheet?
    2: What is printed in this program? null ? anything?
    error?Excel file name is "sample.xls" I set excel file connectivity in my JDBC driver(DSN). Here in my program I am not giving that excel file name. I am giving only that excel sheet name. that is followed
    ResultSet rs = st.executeQuery( "Select * from [Sheet1$]" );The output of this program is given bellow.
    sample:sun.jdbc.odbc.JdbcOdbcResultSet@1b67f74
    samplersd:sun.jdbc.odbc.JdbcOdbcResultSetMetaData@530daa
    numberOfColumns:2

  • Getting Data from C++ STL Vector into Java Vector

    Hi All,
    I have been involved in a project recently to port a lot of C++ code into Java. Testing the ported Java code has been done in isolation with JUnit and works fine, but we would like to test all the ported code. To do this we aim to call the ported (Java) methods from C++ using JNI.
    I have read a lot of the documentation from Sun on the JNI and can access and set Java methods that only contain primitive types without any problems. However what I cant seem to be able to achieve is passing aggregated C++ classes to Java.
    Java
    public void translation_unit_2( Vector v ) { \* code *\ }and somewhere in C++
    jobject actions;                  // Is initialized
    std::vector<Node> test ;   // Node class may contain other objects
    jmethodID tmp = env->GetMethodID(env->GetObjectClass(actions), "translation_unit_2", "(Ljava/util/Vector;)V");
    env->CallObjectMethod(actions, tmp, test);Now obviously what I have posted there doesnt work, but can anybody point me
    in the correct direction to pass the Vector and its Data in C++ to Java?
    None of the Java methods are native, because the eventually the whole system
    will be operating solely in Java, but the testing at this stage is quite important.
    If this is an impossible task then please say so also, any help will be appreciated !
    Thanks,
    Mark Hennessy

    Thanks for the reply and I understand that running an iterator
    over the vector would be the way the get the data out of the C++ Vector.
    However that still leaves me with the question of mapping an arbitrary
    C++ class ( which in the case of the example above would be a Node class which is
    composed of other aggregated classes ) to a jobject such that I can pass
    the data easily to Java throught JNI?
    Is this possible or would I have to decompose each and every class to its most
    primitive types and pass them over to Java and reconstruct them on the Java side?

  • Is it possible to read data from MATLAB *.mat file using LabVIEW?

    I have *.mat file from Matlab with some data. Does anybody know how to extract them from this file. I need to know the file format.
    Oleg Chutko.

    The Mathworks site is pretty good about having documentation for the formats of their file types. I recommend looking there for the format.

  • Copying data from a web page into Numbers

    I frequently use a Keyword Density Analysis Tool on the web that displays three columns and perhaps 50 to 100 rows of data. There is no export or save to csv, so I just highlight the three columns, copy and paste into a blank Excel spreadsheet - and hey presto, I get three columns of data. that I can sort and analyse. When I do the same with Numbers I get three columns but all the data ends up in three rows - please see attached. Is there a simple way around this because I am trying to stop using Excel? Thanks./Volumes/garyloch/Public/Screenshots/Picture 2.png
    /Volumes/garyloch/Public/Screenshots/Picture 1.png
    /Volumes/garyloch/Public/Screenshots/Picture 3.png

    The only way I was able to reproduce what you described is to run the script after copying a picture.
    Here is a refined version.
    It make two attempts to grab text items from the clipboard.
    If both failed, it send an error message.
    --[SCRIPT table2text]
    Enregistrer le script en tant qu'Application ou Progiciel : table2text.app
    déplacer l'application créée dans le dossier
    <VolumeDeDémarrage>:Users:<votreCompte>:Library:Scripts:Applications:
    Il vous faudra peut-être créer le dossier Applications.
    Copiez vos données dans le Presse-papiers.
    menu Scripts > table2text
    Le presse-papiers sera alimenté par le composant Text ou utf8 du contenu initial.
    +++++++
    Save the script as an Application or an Application Bundle: table2text.app
    Move the newly created application into the folder:
    <startup Volume>:Users:<yourAccount>:Library:Scripts:Applications:
    Maybe you would have to create the folder Applications by yourself.
    Copy your block of datas to the Clipboard.
    menu Scripts > table2text
    The Clipboard will be filled with the text or the utf8 component of its original contents.
    Yvan KOENIG (Vallauris, FRANCE)
    4 février 2009
    --=====
    on run
    try
    set the clipboard to (the clipboard as text)
    on error
    try
    set the clipboard to (the clipboard as «class utf8»)
    on error
    if my parleFrancais() then
    error "Pas de données texte dans le presse-papiers !"
    else
    error "No valid text data in the Clipboard !"
    end if
    end try
    end try
    end run
    --=====
    on parleFrancais()
    local z
    try
    tell application theApp to set z to localized string "Cancel"
    on error
    set z to "Cancel"
    end try
    return (z = "Annuler")
    end parleFrancais
    --=====
    --[/SCRIPT]
    Yvan KOENIG (from FRANCE mercredi 4 février 2009 21:49:14)

Maybe you are looking for