Read HTML Source

Hi,
How are all of you? I have a very simple but urgent question.
I just want to know if it is possible to read the page's HTML
source and store it in a String type variable. For example,
If I have this function
public function GetHTML():void
HTMLService = new HTTPService();
HTMLService.url = "
http://foreign-drugstores-online.com/order.htm";
HTMLService.addEventListener(ResultEvent.RESULT,
ServiceHandler);
HTMLService.send();
Now can you please let me know how to store the page source
as a String. I tried to use var str:String =
event.result.toString(); but it display "[object][/object]"
Any suggestion and help will be greatly appreciated.
I shall be very thankful to you.
Best Regards
..::Wahab

Hi,
BIJ001 wrote:
Did you try to pull the URL "by hand", that is, with a browser? the previous poster just asked you to give it a try. So sit sown, use your web browser, type the URL in question and look what happens. You also get a 403 FORBIDDEN? Then it is really forbidden. Even Java can't do it.
Martin

Similar Messages

  • ABAP WD, Read the source code of a html page

    Hi all,
    I have the URL link of .jsp page and I want to get the source code generated by this page to extract some data for my web dynpro.
    How do i solve this?
    Thanks

    Hi Antonio,
    not sure if i understand the question properly.
    You want to read html content of http site rendered via jsp.
    You can use cl_http_client
    to write a simple http client tool.
    This tool opens the page.  The html content is available to this class.
    You can extract the content here.
    See the attribute 'response' after making a call.
    regards
    Phil.

  • How to read the html source code of a webpage.

    How can I read the html source code of a webpage with a java application?
    Is there a good idea?

    >
    How can I read the html source code of a webpage
    with a java application?
    Is there a good idea?
    I don't know if this is a good idea, but it works.
    1) Use a URL to obtain the document's location
    2) Use a URLConnection to open a connection between your computer and the
    document server
    3) Connect to the server
    4) Get the InputStream of said connection
    5) Associate the Input Stream with a Buffered Input Stream
    At this point you can use a loop to read lines from the BufferedInput Stream and append them to a TextArea or other suitable text component.

  • How to read and then extract HTMl source code using java program?

    Hi,
    Could someone tell me how to read and then extract the content of certain tag from html source code. For example, given url http://.... , I would like to know what the <Title> content <Title> in that page is.
    Any help is greatly appreciate.

    Use a URLConnection to make the connection to the page at the needed URL. From the URLConnection, you can get an InputStream that is the stream of data from that page. Just search through the stream and find the <title> tags (don't forget to check for case sensitivity).

  • Java app to save html source and copy to clipboard

    I'm new to Java, and I'm doing a research paper which requires gathering data from the internet. I basically need to learn commands to create an app (which I will execute on a daily basis using Windows scheduler) to do the following task:
    1. Access a specific URL
    2. Save the HTML source as a text file
    3. Copy some of the text in the saved text file to the clipboard in Windows
    4. Paste this data in Excel
    5. Run a macro in Excel to sort the data
    I know enough VBA and Excel functions to parce the data, but if it is easier to use Java to sort the data into columns and rows in Excel, I would like to learn how to do that too.
    I'm running Windows XP. My friend tells me to download Dr. Java to edit .java files and also the SDK to compile the files. He also told me to find modules from the internet which I can use, but I'm not sure how to go about it. (I tried searching on the net but didn't get the hits I wanted.)
    Any help at this point would be much appreciated.

    If your target html is so fancy and complicated(table cell contain another table) or the table miss some <tr> or <td> tags, dividing the table into rows and column can be a difficult task.
    I recommend you choose the website with high download speed. Otherwise, you have to write more code to handle any loading failure.
    I recommend you use httpunit to get webpage with Java program. (There is usually proxy server in University, you can config the parameter for proxy server in the Java program calling httpunit)
    http://httpunit.sourceforge.net/
    It will take some times to learn those Java technique.

  • Help in creating a Java class to convert Html source to XML

    He Everyone!
    I am using selenium as my automation tool
    I got the htmlsource of the page using selenium.
    Now i have to write a Java class which will convert the data (html source)
    (and output a data structure in standard XML format
    Can anyone give me an example codejava class) in how to acheive this please?
    Please mail to
    [email protected]
    Many thanks

    getafix14 wrote:
    Can anyone give me an example codejava class) in how to acheive this please?
    Please mail to
    [email protected]
    Sorry Charlie, but this isn't a "mail me the codez" forum. Either use Google, or try to share your problem and their solutions in the forum. Besides, a little Googling will find you a solution.

  • 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.

  • Characters missing in HTML source

    In ApEx 3.0.0.00.20 on Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Prod I have problems viewing the HTML pages in frontend. I miss some characters in the HTML source. The contents displayed are loaded from the database where they are saved correctly. When reloading the page, the errors appear randomly in other places in the source.
    Example:
    <b>(Textb></b>
    instead of
    <b>(Text)</b>
    The missing characters are not accpetable if buttons do not appear or processes do not run. The appilcation also runs on another instance without those bugs so this is not an application error.
    What I would like to know is if someone else ever had the same problem and if it is a performance error or if the error is found in the database or in the ApEx installation.
    Thanks in forward for your replies,
    Patrick
    Edited by: Pennypacker on Sep 16, 2009 11:00 AM
    Edited by: Pennypacker on Sep 16, 2009 11:01 AM
    Edited by: Pennypacker on Sep 16, 2009 11:02 AM

    Sorry for my bad example, this might confuse because I cannot add HTML tags here. The problem is not that the text is bold or not. I try to give more examples to make the problem clear.
    Example 1:
    input type="radio" name="f15" value="1" />1
    The < character is missing in front of the line, so no radio button is displayed and the HTML source code is shown as text in the browser.
    Example 2:
    Shown Text: zu helfennd einige Fragen zu beantworten
    Text in Database: zu helfen und einige Fragen zu beantworten
    +2 Characters missing+
    In the example above I meant that also the '<' character was missing and the bold-tag was not closed so that all text was shown bold.
    So the HTML code is not generated correctly by ApEx and randomly 1 or 2 characters are missing which makes the site unuseable. Any ideas?

  • Html source

    I'm new to apex.. I had written my HTML source code in the html body attribute section that is available in the page.. i had created a link.. this link i want it to appear in the main region(reports region).. but it appears at top of my page while i run this page dynamically.. what should i do about that?

    Hi,
    you have to create regions, position them on the page, and put your HTML source in the Region Source.
    The "html body attribute" must only contains attributes for the <body> tag of the page (for example onload="...").
    I suggest you to read the documentation.
    Yann.

  • 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.

  • 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.

  • 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.

  • 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.

  • 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.

  • 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,

Maybe you are looking for

  • Any table or program to get the number of records in P, A and F tables

    HI all any table for program to get the number of records in P, A and F tables. I want to create SQ01 queries to get the status of number of records. We are gng for a production cutover next week. Want to capture all the data before and after Upgrade

  • Aiport Express Sharing problem.

    I'm having trouble getting my Airport Express to broadcast my internet. Here is the current set up. The internet modem is connected to an ethernet switch, so that my roommates mac desktop can be hardwired(no wireless) and so i can connect the airport

  • BGP default route advertisement - change preference

    hi guys, I would appreciate some assistance here. We have a primary head office & a DR site. Routers at both sites connect to our carrier for an IP VPN service using BGP. BGP configs on each router advertise a default route 0.0.0.0.    #sh ip bgp nei

  • Need information on Detached portlet

    Hi, Do any one have an idea of what exactly is detached portlet and how to implement it.I got a few lines of information in edocs..but when i tried it didnt work. So can any one tell me how to implement detached portlet. My exact requirment is....in

  • Can we avoid the message  while opening downloaded excel file.

    Hi, I have an interesting issue. In my scenario I am downloading characteristics value from COID. Through background job we are getting that report in our Out look mail box. Report format is XLS. While opening the attached XLS file we are getting one