Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 8 of 8

Thread: fetch HTML page content from the web ( by executing javascript ) using stand alone

  1. #1
    Junior Member
    Join Date
    Feb 2011
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default fetch HTML page content from the web ( by executing javascript ) using stand alone

    HI
    i need some help with the following problem:

    i need to fetch HTML page content from the web using stand alone Java class
    the problem is that the page i want to fetch don't have DIRECT URL and can be reach only from other page by executing javascript code


    the base ur is : Passenger Information - Online Flights
    and the java script that should be executed exist on "All flights" link


    for summery i need to access the fist page from stand alone java class execute the js function and get the result HTML as String


    any one can help?


    hope it's clear , if not please feel free to ask for more info


    Thanks


  2. #2
    Administrator copeg's Avatar
    Join Date
    Oct 2009
    Location
    US
    Posts
    5,318
    Thanks
    181
    Thanked 833 Times in 772 Posts
    Blog Entries
    5

    Default Re: fetch HTML page content from the web ( by executing javascript ) using stand alon

    Cross posted at fetch HTML page content from the web ( by executing javascript ) using stand alone .
    Crossposting is not against the rules of this forum, but we ask to provide links to other locations the question was asked. For reasons, see The problems with crossposting

  3. #3
    mmm.. coffee JavaPF's Avatar
    Join Date
    May 2008
    Location
    United Kingdom
    Posts
    3,336
    My Mood
    Mellow
    Thanks
    258
    Thanked 294 Times in 227 Posts
    Blog Entries
    4

    Default Re: fetch HTML page content from the web ( by executing javascript ) using stand alon

    Hey johny,

    This is interesting. How far have you got?
    I will have a play with it and get back to you.
    Please use [highlight=Java] code [/highlight] tags when posting your code.
    Forum Tip: Add to peoples reputation by clicking the button on their useful posts.

  4. #4
    Junior Member
    Join Date
    Feb 2011
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: fetch HTML page content from the web ( by executing javascript ) using stand alon

    Quote Originally Posted by JavaPF View Post
    Hey johny,

    This is interesting. How far have you got?
    I will have a play with it and get back to you.

    im still tin the beginning , didn't manage to execute the js and The HTML back.

    hope you can help me

  5. #5
    mmm.. coffee JavaPF's Avatar
    Join Date
    May 2008
    Location
    United Kingdom
    Posts
    3,336
    My Mood
    Mellow
    Thanks
    258
    Thanked 294 Times in 227 Posts
    Blog Entries
    4

    Default Re: fetch HTML page content from the web ( by executing javascript ) using stand alon

    My plan was to download the .js files from the server and then look to see what the executed function does.. This might give a clue as to how to move forward.
    Please use [highlight=Java] code [/highlight] tags when posting your code.
    Forum Tip: Add to peoples reputation by clicking the button on their useful posts.

  6. #6
    Junior Member
    Join Date
    Feb 2011
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: fetch HTML page content from the web ( by executing javascript ) using stand alon

    Quote Originally Posted by JavaPF View Post
    My plan was to download the .js files from the server and then look to see what the executed function does.. This might give a clue as to how to move forward.
    this is the called method : javascript:__doPostBack('lnkShowGridWithPaging','' )

    and this is the source code of the method

    <script language="javascript" type="text/javascript">
    <!--
    	function __doPostBack(eventTarget, eventArgument) {
    		var theform;
    		if (window.navigator.appName.toLowerCase().indexOf("microsoft") > -1) {
    			theform = document.Form1;
    		}
    		else {
    			theform = document.forms["Form1"];
    		}
    		theform.__EVENTTARGET.value = eventTarget.split("$").join(":");
    		theform.__EVENTARGUMENT.value = eventArgument;
    		theform.submit();
    	}
    // -->
    this is the only place in all files ( in the HTML file) i found the method , but it's commented out

    please advice

    Thanks

  7. #7
    mmm.. coffee JavaPF's Avatar
    Join Date
    May 2008
    Location
    United Kingdom
    Posts
    3,336
    My Mood
    Mellow
    Thanks
    258
    Thanked 294 Times in 227 Posts
    Blog Entries
    4

    Default Re: fetch HTML page content from the web ( by executing javascript ) using stand alon

    Can you post the entire .js file please

    I'm interested in eventTarget
    Please use [highlight=Java] code [/highlight] tags when posting your code.
    Forum Tip: Add to peoples reputation by clicking the button on their useful posts.

  8. #8
    Junior Member
    Join Date
    Feb 2011
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: fetch HTML page content from the web ( by executing javascript ) using stand alon

    Quote Originally Posted by JavaPF View Post
    Can you post the entire .js file please

    I'm interested in eventTarget
    the files are attached
    Attached Files Attached Files

Similar Threads

  1. issue in executing Stored Proc
    By Bhawesh Kurmi in forum JDBC & Databases
    Replies: 1
    Last Post: December 8th, 2010, 10:05 AM
  2. Executing Oracle Procedure
    By java_mein in forum JDBC & Databases
    Replies: 0
    Last Post: May 14th, 2010, 02:41 PM
  3. How to fetch integer data from excel
    By nehakuls in forum JDBC & Databases
    Replies: 5
    Last Post: May 14th, 2010, 01:44 AM
  4. Replies: 2
    Last Post: October 14th, 2009, 10:10 AM
  5. Replies: 8
    Last Post: August 6th, 2009, 01:35 PM