Retrieving HTML source code of a web page

Hi,
  I want to take the HTML source code of a web page. How can I take?
Thanks and regards,
Venkat.

You can do that with the class "cl_http_client".
Sample code:
DATA: http_client TYPE REF TO if_http_client .
DATA: w_string TYPE string ,
w_result TYPE string ,
r_str TYPE string .
DATA: result_tab TYPE TABLE OF string.
START-OF-SELECTION .
CLEAR w_string .
w_string = 'http://urlhost/Logs/main.asmx/SetLog'.
CALL METHOD cl_http_client=>create_by_url
EXPORTING
url                = w_string
IMPORTING
client = http_client
EXCEPTIONS
argument_not_found = 1
plugin_not_active  = 2
internal_error     = 3
OTHERS = 4.
CALL METHOD HTTP_CLIENT->REQUEST->SET_HEADER_FIELD
EXPORTING
NAME = '~request_method'
VALUE = 'POST'.
CALL METHOD http_client->REQUEST->SET_FORM_FIELD
EXPORTING
NAME = 'title'
VALUE = 'Mail sistema'.
CALL METHOD http_client->REQUEST->SET_FORM_FIELD
EXPORTING
NAME = 'details'
VALUE = 'Funcion 1234'.
CALL METHOD http_client->send
EXCEPTIONS
http_communication_failure = 1
http_invalid_state         = 2.
CALL METHOD http_client->receive
EXCEPTIONS
http_communication_failure = 1
http_invalid_state         = 2
http_processing_failed     = 3.
CLEAR w_result .
w_result = http_client->response->get_cdata( ).
REFRESH result_tab .
SPLIT w_result AT cl_abap_char_utilities=>cr_lf INTO TABLE
result_tab .
READ TABLE result_tab INTO r_str INDEX 2.

Similar Messages

  • How can I get HTML source code of dynamic Web page ?

    Hi,
    I would like to write a program that can get HTML source code of some Web pages, but there are some dynamic Web pages that I can't do it with URL class. For example: http://www.europlex.ch/web/3schedule/showAll.jsp?context=schedule.
    Thank you very much for any solution.

    Thank you for your attention. I'm sorry because I could't describe it clearly. If you don't mind, please follow this step to understand my problem:
    In the browser, enter URL: http://www.europlex.ch/web/main.jsp?locale=_english
    Click on Schedule, you will see the page with Cinema name, Film, Time... I would like to write Java Program to get HTML code of only this Page (Not frame page).
    Do you have any idea ?
    Thanhks,

  • Html code(source code) for  a web page

    hi all
    i want to get the source code for a web page throgh
    my java program .please can you tell me how to do it.
    thanks

    give this a try.
    import java.awt.*;
    import javax.swing.*;
    import java.net.*;
    import java.io.*;
    public class JApplet1 extends JApplet
         public void init()
              getContentPane().setLayout(null);
              setSize(470,391);
              JButton1.setText("google.com");
              getContentPane().add(JButton1);
              JButton1.setBounds(12,12,120,24);
              getContentPane().add(JScrollPane1);
              JScrollPane1.setBounds(12,48,444,336);
              JScrollPane1.getViewport().add(JTextArea1);
              JTextArea1.setBounds(0,0,440,332);
              SymMouse aSymMouse = new SymMouse();
              JButton1.addMouseListener(aSymMouse);
         javax.swing.JButton JButton1 = new javax.swing.JButton();
         javax.swing.JScrollPane JScrollPane1 = new javax.swing.JScrollPane();
         javax.swing.JTextArea JTextArea1 = new javax.swing.JTextArea();
         class SymMouse extends java.awt.event.MouseAdapter
              public void mouseClicked(java.awt.event.MouseEvent event)
                   Object object = event.getSource();
                   if (object == JButton1)
                        JButton1_mouseClicked(event);
            URL u;
         URLConnection conn;
         InputStreamReader in;
         BufferedReader data;
         String line;
         StringBuffer buf = new StringBuffer();
         void JButton1_mouseClicked(java.awt.event.MouseEvent event)
             try{
                 u = new URL("http://www.google.com");
                  conn = u.openConnection();
                  in = new InputStreamReader(conn.getInputStream());
                  data = new BufferedReader(in);
                  while((line = data.readLine()) != null)
                      buf.append(line + "\n");
                  JTextArea1.setText(buf.toString());
              }catch(Exception e){}
    }

  • Read Source code of a Web Page

    Hi,
    Could anyone suggest an ABAP Function module which when given a web page URL as input downloads the source code of the web page into an internal table. Thanks.
    Regards,
    Prabaharan.

    Hi,
    Chek this link:
    Extracting data from a HTML / XML web page
    Hope it helps you.
    Pleae reward helpful answers.
    Best Regards,
    Anjali

  • I just purchased photoshop elements and went to retrieve my serial code.  The web page provided to retrieve it loads blank, even when clicking on the URL through adobe's web site.  I can not install my product without this.  Please help

    I just purchased photoshop elements and went to retrieve my serial code.  The web page provided to retrieve it loads blank, even when clicking on the URL through adobe's web site.  I can not install my product without this.  Please help

    Drusso77 if you are continuing to face difficulties locating your serial number then please see Find your serial number quickly - http://helpx.adobe.com/x-productkb/global/find-serial-number.html.  You are also welcome to contact our support team at http://adobe.ly/1aYjbSC.

  • View the html source code of an apex page

    Hi everyone,
    I search to how I can view the html source code of an apex page and to be able to modify it. That's why viewing the html source code from the browser when the application is running doesn't arrange me.
    Has anyone an idea how it can this be possible?
    Best regards,

    Khadija Khalfallah wrote:
    Hi everyone,
    I search to how I can view the html source code of an apex page and to be able to modify it. That's why viewing the html source code from the browser when the application is running doesn't arrange me. What do you mean?
    Do you want to be able to pull up the HTML source generated by Apex, modify that copy, and then feed it back into Apex with the chagnes you made? If so you can't. Apex generates the HTML through its tools and you have to modify the generation routines to get different HTML.
    Do you merely want to look at the generated HTML? In Internet Explorer all you have to do is right click on the page and choose View Source to open a window with the HTML source in an editor. I sometimes find it useful to save a page and manually edit the copy to immediately see the effects of certain changes to the underlying HTML and/or Javascript without permanantly making the change in Apex.

  • Retrieving The source code of a web.

    Hi,
    Sorry if this is not the place fro this post but I didn�t know where to put it.
    I need to connect to a web page and get the page source code to retrieve the text it has to preprocess it and insert in my BD. Is there any way to do this in java?.
    Thanks in advance,
    HexDump.

    Sure.
    http://java.sun.com/docs/books/tutorial/networking/urls/readingURL.html

  • Are we allowed to use the Web developer function in Firefox version 5.0 to edit the html source code associated with the Firefox home page?

    Locking at request of OP - https://support.mozilla.com/en-US/questions/844506
    Are we allowed to use the Web developer function, under the "Firefox" tab in Firefox version 5.0, to edit the html source code associated with the Firefox version 5.0 home page ( so that we can personalize the home page )? Is this legal?
    Sincerely in Christ,
    Russell E. Willis

    Solution: (Free Download Manager)
    Go here: http://codecpack.co/download/Free_Download_Manager.html and download Free Download Manager 3.8.1067 Beta 3, it works perfectly with Firefox 5.0.1
    Solution: (to Google mail aka Gmail)
    I have had this problem for a while since I did a previous Firefox update, where I had to force Gmail to load in Basic HTML else it's next to impossible to use it. The solution is this: simply update your Java, and Gmail will work without a problem using Standard HTML. To update your Java go here: http://www.java.com/en/ and select "Free Java Download".
    And beta normally, universally, means "the not quite there yet version of the version we're aiming for" NORMALLY used during production and testing of a type of software.

  • HTML source code is rendering instead of web page

    Hi All,
    I have firefox 3.6.13. For some of the pages it is displaying HTML source code as it is without rendering or applying CSS and scripts to display properly designed web page.
    can u tell me if there is setting which causing this issue? but that way, i should have faced for all the pages.
    which all factors can cause this?

    A possible cause is security software (firewall) that blocks or restricts Firefox or the plugin-container process without informing you, possibly after detecting changes (update) to the Firefox program.
    Remove all rules for Firefox from the permissions list in the firewall and let your firewall ask again for permission to get full unrestricted access to internet for Firefox and the plugin-container process and the updater process.
    See:
    *https://support.mozilla.com/kb/Server+not+found
    *https://support.mozilla.com/kb/Firewalls

  • CQ page is not rendering properly. It is not rendering HTML. It is showing HTML source code as is.

    On some of the pages, I am getting this weird behavior wherein page is not rendering properly. It is showing HTML source code as is. Could you please help me out? What could be the issue? And how can we get rid of the same?

    Check your component jsp page. it is possible that it is just plan file without directives <@ or you might have miss to close tag which is creating source as text to render
    Paste your jsp code in case you need further help
    Thanks,
    Ajit

  • How to get the HTML Source code from the active browser ?

    Hi All,
    I need to get the HTML Source code from the active browser (IE). I tried with the below code, but I am not able to get the Source code all the time, with respect to the different applications (http or https) and the user authentication has to be changes in few applications (_I dont know or not able to given that in the below code_). More over there is also a dependence of the URL to get the HTML Source code.
    Therefore what I feel is getting the HTML Source code from the given or active browser will be consistent than the URL. Since the Source code is available in the browser (IE) . Please help me with a sample code to achieve this . . . !
    HTMLDocument doc=(HTMLDocument) kit.createDefaultDocument();
    doc.putProperty("IgnoreCharsetDirective", Boolean.TRUE);
    URL url = new URL(strURL);
    Reader HTMLReader = new InputStreamReader(url.openConnection().getInputStream());
    kit.read(HTMLReader, doc, 0);Thanks in advance,
    Regards,
    Jothi Venkatachalam
    Edited by: j0o on May 7, 2009 3:11 AM

    The simple answer is: you don't.
    Not only is it simply not possible, but the entire concept of "the active browser" doesn't exist.
    You were on the right track with your code to retrieve the page directly from the server, but as you noticed that code will only work for regular http connections.
    For https and other protocols you will need to use appropriate libraries for each protocol. Something like Apache Commons can help you with that. There are networking libraries in there for a lot of commonly used protocols.

  • I see the license agreement as HTML source code

    Hello,
    I downloaded a trial version of Adobe Acrobat 9.0,
    but after I had installed it and start it, it wants me to agree on the license agreement.
    but my problem is that I can't click on Agree nor Disagree because I see only HTML source code
    see the printscreen I added below.
    does anyone know what is wrong, or wat I have to install to 'use' these HTML pages whitin Adobe Acrobat?
    I also downloaded the software again and installed it again and it happens also with trial versions of photoshop,
    I have not tested other software so far.
    Thanks in advance
    Kees
    PS: I am dutch so my english is not perfect.

    You seem to have missed this thread:
    http://www.adobeforums.com/webx/.3bc424c7/
    I understand Liam's suggestion has worked for many.

  • How to edit the html source code for my site

    I have just started a blog, and am VERY new to it. I am trying to edit the html source code on my site (ie, to insert google adsense search bars). I go to my blog site, get to page source and see the html but I am not able to edit it. Not sure what I am doing wrong. Thanks!

    You can use any editor you want mine is set up for notepad.exe
    :see http://dmcritchie.mvps.org/firefox/firefox.htm#notepad
    :to invoke use "Ctrl+U" or View > Page Source
    :this is for sites that you maintain on your local drives or servers, and copy over to a website.

  • How to highlight HTML source code in JEditorPane

    I used JEditorPane to display the HTML source code. Now I want to highlight some part of the HTML code.
    e.g. change the font or color of the second line in this piece of HTML code.
    I tried to highlight the text in HTML way, e.g.
    JEditorPane jep=new JEditorPane():
    jet.setContentType("text/html");
    jet .setText("<html><i>display styled text</i></html>");
    but it didn't work at all. As the text I want to highlight is alreay a part of the HTML code.
    I have to sort it out ASAP. as the deadline of my project is coming...
    any advice is appreciated.
    Thanks so much..:)

    "In order to display the original html source code (not the effect made by HTML code ) i n JEditorPane,
    i can't use editorPane.setContentType("text/html"): As it will try to render the webpage with this piece of HTML code..
    e.g. here is the piece of html code i want to display in JEditorPane:
    <HTML><HEAD><TITLE>Department of Computer Science Home Page</TITLE>
    <META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
    <META content="MSHTML 6.00.2737.800" name=GENERATOR>
    </HEAD>.........</HTML>
    what i want to do is to highlight "Department of Computer Science Home Page" by setting it bold or italic."
    Not really sure what you're saying here, but it sounds like you mean that you want the HTML itself to change. If that's it just:
    <HTML>
    <HEAD>
      <TITLE>Department of Computer Science Home Page</TITLE>
      <META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
      <META content="MSHTML 6.00.2737.800" name=GENERATOR>
    </HEAD>
    <BODY color='blue' bgcolor='white'>
      <tr>
       <td bgcolor=yellow>Department of Computer Science Home Page</td>
      </tr>
    </BODY>
    </HTML>FWIW HTH, B4N
    ~Bill

  • Hide html  (source) code

    hi,
    I want to hide html code of my web pages and of my css-page.
    I found one way in using a commercial tool to encrypt the code.
    is there another way, and if not, can anyone give me a tip
    which tool is the best?
    Thank's for help
    Jens

    > is there another way
    No. What is so valuable in your code, anyhow?
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.dreamweavermx-templates.com
    - Template Triage!
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    http://www.macromedia.com/support/search/
    - Macromedia (MM) Technotes
    ==================
    "kikde" <[email protected]> wrote in message
    news:e9l9e3$j9s$[email protected]..
    > hi,
    > I want to hide html code of my web pages and of my
    css-page. I found one
    > way
    > in using a commercial tool to encrypt the code.
    >
    > is there another way, and if not, can anyone give me a
    tip which tool is
    > the
    > best?
    >
    > Thank's for help
    >
    > Jens
    >

Maybe you are looking for

  • HP PAVILION DV6T-7000 NOTEBOOK

    i bought a HP PAVILION DV6T-7000 NOTEBOOK and not even a year and the buttons on key board start moving and for the irony,when the warranty expired i lost the space buton,long story short went to buy one keyboar but based on hp specification part num

  • When exporting PDF into Excel works great - with one exception

    In converting a pdf into an excel document (with 10 columns) all of the columns and the data line up accurately after conversion - except for one of them. 5 of the columns are numerical values and 5 are characters/letters (in mixed order). The column

  • Trigger disappear after logout

    Hi, I created a trigger which is working ok, but what I don't understand is that I have to reload it after each login. Instead of trigger name, I see "Bin$..." in sql developer tree. How can I set this trigger to be permanent ? Thanks, Olivier

  • Jdeveloper does not show sequence and table name in dB navigator.

    Hi my jdev version is 11.1.1.5.0 I have a table and sequence.I need to map sequence to this table. But i don't see this table and sequence in jdeveloper DB navigator under my connection.Why is this happening?

  • Colour Pearl w/o Software Disc

    *I'm trying to get colour pearl for my 8100 because my trackball appears to be a little discolored & its really ugly. *I DO NOT have the software disc for my BB. *Can someone help me out by telling me what software I need to download of the BB websit