🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.cppbuilder.internet.socket
11 messages
11 total messages Started by Eduardo Jauch Thu, 18 Jan 2007 00:25
Internet Programming
#1444
Author: Eduardo Jauch
Date: Thu, 18 Jan 2007 00:25
37 lines
2214 bytes
Hello!

I don't know if this is the correct place for my questions. If no, 
forgive me.

I'm programing c++ for a while now, but never do any program for "internet".

Now, I need to do a program to read an internet page (like internet 
explorer) and send to this page some information.

What I pretend is to automate some functions.

For example:

There are 3 combo box in this page. The first is refreshed when the page 
is loaded. When I select a value on this combo box, the pege load the 
values on the second and so on.

My program must load only this combo (and the code associated with it) 
and if don't find the value that I want, refresh the page to load the 
combo again. When find the value, select it and execute the code of the 
page, to load the second combo box, and so on, I don't need really show 
nothing, and if this speed the operation, good.

Is that possible to do with Borland C++ 2006? I'm using Enterprise.

If is, what components I'll may need, what books are good to teach this 
type of programing, there are good sites to search information, I need 
to take a look in another forum here?

Thanks for all help that you can give me :)

Bye!


Eduardo Jauch
Curitiba, Paran�, Brasil
Re: Internet Programming
#1445
Author: Hans Galema
Date: Thu, 18 Jan 2007 10:38
35 lines
1974 bytes
Eduardo Jauch wrote:

> There are 3 combo box in this page.

Do you mean <select> .. </select> ?

> The first is refreshed when the page 
> is loaded. When I select a value on this combo box, the pege load the 
> values on the second and so on.

Does it grab a different page from the webserver then or does
the javascript handle all?

> My program must load only this combo (and the code associated with it) 
> and if don't find the value that I want, refresh the page to load the 
> combo again. When find the value, select it

Do you mean that one of the <option>...</option> has to be 'selected' first?

Loading the selectbox without loading the complete htmlpage will not do
because it is part of that page.

> and execute the code of the 
> page, 

What is 'the code of the page'? Javascript?

 > to load the second combo box, and so on, I don't need really show
> nothing, and if this speed the operation, good.

All three comboboxes will be there is the page is loaded. Or not?

Please be more exact. Could you givne an url?

Hans.
Re: Internet Programming
#1451
Author: Eduardo Jauch
Date: Fri, 19 Jan 2007 23:21
73 lines
3645 bytes
LOL

How many questions... hehe

Hans Galema escreveu:
> Eduardo Jauch wrote:
> 
>> There are 3 combo box in this page.
> 
> Do you mean <select> .. </select> ?
> 

Well... I don't have access to the page now, but I think yes... I really 
don't Know... There are other way?

>> The first is refreshed when the page is loaded. When I select a value 
>> on this combo box, the pege load the values on the second and so on.
> 
> Does it grab a different page from the webserver then or does
> the javascript handle all?

Oh my... I dn't know too... But the page is all rebuild when this happens...

>> My program must load only this combo (and the code associated with it) 
>> and if don't find the value that I want, refresh the page to load the 
>> combo again. When find the value, select it
> 
> Do you mean that one of the <option>...</option> has to be 'selected' 
> first?
> 

I don't get it (but my knowledge of HTML is very poor anyway)
When the page is loaded, there are some values in the first ombo box. 
The first is "select". The others are the avaiable "months" to the 
users. If he click the combo, the values are show. When he click 
(select) one of then, the next combo, the page seens to "reload" and the 
next combo that was empty until now, is filled with the avaiable dates 
to the user. Doing the same with this combo, clicking in one of the 
dates, the page seens to be reload and the third combo (after the page 
seens to be reload) is filled with avaiable times...

> Loading the selectbox without loading the complete htmlpage will not do
> because it is part of that page.
> 
>> and execute the code of the page, 
> 
> What is 'the code of the page'? Javascript?

I don't know this point, but I know that to go to this page, there are 
one button that execute javascript. I'm wondering only, but I think that 
this all are made via javascript, but don't know for shure...

> 
>  > to load the second combo box, and so on, I don't need really show
>> nothing, and if this speed the operation, good.
> 
> All three comboboxes will be there is the page is loaded. Or not?
> 
> Please be more exact. Could you givne an url?

In fact, to access this homepage, you have to use a password, that I 
don't have. I only can access with other people entering it for me. 
Forgive me. :)
> 
> Hans.

But thanks for the replay. I hope that I could give you more information...

If you know of good sites and books to learn how to program for internet 
using C++ and the components (like Indy, a friend told me) I'll 
appreciate :)

Peace! :)
Re: Internet Programming
#1453
Author: Eduardo Jauch
Date: Mon, 22 Jan 2007 22:47
43 lines
2226 bytes
Hans Galema escreveu:
> Eduardo Jauch wrote:
> 
>> There are 3 combo box in this page.
> 
> Do you mean <select> .. </select> ?
> 
>> The first is refreshed when the page is loaded. When I select a value 
>> on this combo box, the pege load the values on the second and so on.
> 
> Does it grab a different page from the webserver then or does
> the javascript handle all?
> 
>> My program must load only this combo (and the code associated with it) 
>> and if don't find the value that I want, refresh the page to load the 
>> combo again. When find the value, select it
> 
> Do you mean that one of the <option>...</option> has to be 'selected' 
> first?
> 
> Loading the selectbox without loading the complete htmlpage will not do
> because it is part of that page.
> 
>> and execute the code of the page, 
> 
> What is 'the code of the page'? Javascript?
> 
>  > to load the second combo box, and so on, I don't need really show
>> nothing, and if this speed the operation, good.
> 
> All three comboboxes will be there is the page is loaded. Or not?
> 
> Please be more exact. Could you givne an url?
> 
> Hans.


I take a look at the code of the page today...
Looks like the work is all by javascript...

There some way of work with this?

Eduardo Jauch
Re: Internet Programming
#1454
Author: Hans Galema
Date: Tue, 23 Jan 2007 10:16
14 lines
1266 bytes
Eduardo Jauch wrote:

> I take a look at the code of the page today...
> Looks like the work is all by javascript...
> 
> There some way of work with this?

Yes. T(Cpp)WebBrowser can handle every html page.

But please be more exact if you want help.

Please provide the url.

Hans.
Re: Internet Programming
#1455
Author: Eduardo Jauch
Date: Tue, 23 Jan 2007 19:59
129 lines
4872 bytes
Hello.
I can't pass to you the password to the site, Id like but can't.
Without the password, you can't see the page I must work on...

How you can see, the major part does nothing but show pictures.

But a few java code is what do all the work. In fact, all the 
"different" pages that i acess (with different buttons, etc) have all 
the same code...

What I need to know is if a program write in c++ can Understand what is 
write in this html code, execute these javascripts (like the internet 
explorer e mozzila), and get the result.

I know nothing about Java, so I don't know if is possible "understand" 
what the site will send to the program or it must execute other 
application that will "draw" the page.

I need to get the information that the page send, work with this data 
and simulate a user clicking a button, selecting a value in a combo box, 
etc.

Is this possible if the site executes Java?


Where (what books, sites) can I find to teach me how to program such 
application?


Here is the code of the page (I deleted the parts that show images only):


<script type="text/javascript" 
src="/agendamento-web/scripts/JavaScriptFlashGateway.js"></script>

<script>
var uid = new Date().getTime();
var flashProxy = new FlashProxy(uid, 
'/agendamento-web/swf/JavaScriptFlashGateway.swf');
function loadFlashMenu(arg) {
	flashProxy.call('loadMenu', arg);
}
function RedimFrame(altura) {
	document.getElementById("iContent").height=altura;
}
function PreparePage(altura, _xml) {
	RedimFrame(altura);
}
</script>
<script>
function changeLocale(l){
	
	var frm = frames['iContent'].document.forms[0];
	
	frm.locale.value = l;
	frm.submit();
	
	if(l=='pt_BR'){
		document.title = 'Servi�o de Informa��o para Visto Online';
		document.getElementById('imagemRodape').src = 
'/agendamento-web/images/pt_BR/rodape_01.gif';
		document.getElementById('imagemCabecalho_pt_BR').style.display = '';
		document.getElementById('imagemCabecalho_en_US').style.display = 'none';
	} else {
		document.title = 'Visa Information Service On-Line';
		document.getElementById('imagemRodape').src = 
'/agendamento-web/images/en_US/rodape_01.gif';
		document.getElementById('imagemCabecalho_pt_BR').style.display = 'none';
		document.getElementById('imagemCabecalho_en_US').style.display = '';
	}
}
</script>



	<script src="http://www.google-analytics.com/urchin.js" 
type="text/javascript"> </script>
	<script type="text/javascript">
		_uacct = "UA-368745-1";
		urchinTracker();
	</script>

   <tr>
     <td width="193" align="center" valign="top" class="td_bege">


	<script type="text/javascript">
     	var tag = new 
FlashTag('/agendamento-web/swf/raVistoOnline_Menu_EN_v1.7.0.swf?paramXMLSource=/agendamento-web/jsp/common/menu-xml.jsp?timestamp=1169581041854', 
170, 550);
     	tag.setFlashvars('lcId='+uid);
     	tag.write(document);
	</script>

	</td>
	

<script>
if('pt_BR' == 'pt_BR' || 'pt_BR' == ''){
	document.getElementById('imagemCabecalho_pt_BR').style.display = '';
	document.getElementById('imagemCabecalho_en_US').style.display = 'none';
	document.getElementById('imagemRodape').src = 
'/agendamento-web/images/pt_BR/rodape_01.gif';
} else {
	document.getElementById('imagemRodape').src = 
'/agendamento-web/images/en_US/rodape_01.gif';
	document.getElementById('imagemCabecalho_pt_BR').style.display = 'none';
	document.getElementById('imagemCabecalho_en_US').style.display = '';
}
</script>
</body>
</html>


Hans Galema escreveu:
> Eduardo Jauch wrote:
> 
>> I take a look at the code of the page today...
>> Looks like the work is all by javascript...
>>
>> There some way of work with this?
> 
> Yes. T(Cpp)WebBrowser can handle every html page.
> 
> But please be more exact if you want help.
> 
> Please provide the url.
> 
> Hans.
Re: Internet Programming
#1470
Author: Eduardo Jauch
Date: Thu, 25 Jan 2007 23:36
33 lines
2009 bytes
I'll put the question in another way...


if i need to access a page that execute javascript, the TCppWebBrowser 
will be able to intercept the result of the java code?

For exemple, let's say that a function in java (called from the page in 
question) read a database and after that, create a new view for the 
page, with text, images, buttons etc.

The code that is executed (function java), is executed where? In the 
server or in the TCppWebBrowser?

I will be able to "see" by my code the buttons and the data show in the 
page by the java function, and click teh button, etc?

Thanks :)

Hans Galema escreveu:
> Eduardo Jauch wrote:
> 
>> I take a look at the code of the page today...
>> Looks like the work is all by javascript...
>>
>> There some way of work with this?
> 
> Yes. T(Cpp)WebBrowser can handle every html page.
> 
> But please be more exact if you want help.
> 
> Please provide the url.
> 
> Hans.
Re: Internet Programming
#1385
Author: Hans Galema
Date: Fri, 26 Jan 2007 09:58
22 lines
2064 bytes
Eduardo Jauch wrote:

> The code that is executed (function java), is executed where? In the 
> server or in the TCppWebBrowser?

In the instance of IE that is activated by TCppWebBrowser.

> I will be able to "see" by my code the buttons and the data show in the 
> page by the java function, and click teh button, etc?

Well you are the one who can tell because you can see the original page
choose an item and then see the next page build up by the javascript.

If it works in IE then it usually works in TCppWebBrowser as well.

Is your question: "when javascript creates a button, can I click it
with code?". I think you can. But to investigate that I need a htmlpage
that behaves like that. If you cannot give me your original url (because of
privacy) then search at the internet for a page that behaves about the same.
Post the url and after that we can speak about the same page.

Hans.
Re: Internet Programming
#1398
Author: Eduardo Jauch
Date: Mon, 29 Jan 2007 15:59
77 lines
2871 bytes
Hi Hans,

I was wrong.
The page has a frame...  hehe

In fact, when I saw the code, these combo that I mentioned are created 
by this type of line:


/* FIRST COMBO BOX */ ---> Already selected

<select name="mesDisponivel" class="combo-box" onChange="javascript: 
popularListaDiasDisponiveis();" >
   <option value="">Selecione</option>
     <option value="04/2007" selected >
        Abril 2007
     </option>
</select>
			


/* SECOND COMBO BOX */

<select name="diaDisponivel" class="combo-box" onChange="javascript: 
popularListaHorariosDisponiveis();" >
   <option value="">Selecione</option>
     <option value="11/04/2007"  >
       11/04/2007, Quarta-feira
     </option>
     <option value="12/04/2007"  >
       12/04/2007, Quinta-feira
     </option>
	.
	.
	.
     <option value="30/04/2007"  >
       30/04/2007, Segunda-feira
     </option>
</select>



/* THIRD COMBO BOX */	-----> Empty (need that a value in combo box 2 
be selected							

<select name="seqHorarioAgendamentoDisponivel" class="combo-box" >
   <option value="">Selecione</option>
</select>




/* THREE BUTTONS */

<a href="javascript: confirmarAgendamento();"><img 
src="/agendamento-web/images/pt_BR/bt_confirmar.gif" border="0"></a>&nbsp;

<a href="javascript: confirmarInformacoesDeVisto();"><img 
src="/agendamento-web/images/pt_BR/bt_voltar.gif" border="0"></a>&nbsp;

<a href="javascript: listaSituacaoAgendamento();"><img 
src="/agendamento-web/images/pt_BR/bt_cancelar.gif" border="0"></a>


/* END */

So, the server return this page when I click a button in another.
I need to "read" the values in the combos and eventually "click" in one 
of the buttons...

With TCppWebBrowser I can do it?

By what I saw in other posts, it have some type of "tree" that holds 
every type of object in the page... Is this correct?


Thanks!
Re: Internet Programming
#1412
Author: Hans Galema
Date: Wed, 31 Jan 2007 11:40
44 lines
2590 bytes
Eduardo Jauch wrote:

> <select name="mesDisponivel" class="combo-box" onChange="javascript: 
> popularListaDiasDisponiveis();" >
>   <option value="">Selecione</option>
>     <option value="04/2007" selected >
>        Abril 2007
>     </option>
> </select>

So that is html code and exactly an answer on my first question if it was
<select> ... </select>

You see it has a name atribute "mesDisponivel". You can use the name
to find the select and then query its <option> ... </option>'s.

> /* THREE BUTTONS */
> 
> <a href="javascript: confirmarAgendamento();"><img 
> src="/agendamento-web/images/pt_BR/bt_confirmar.gif" border="0"></a>&nbsp;

That construction 'behaves' like a button. In fact is is an image as
you can see. Where the link is actually javascript, executed
when the user clicks the image, that calls the function
confirmarAgendamento();

> So, the server return this page when I click a button in another.
> I need to "read" the values in the combos and eventually "click" in one 
> of the buttons...

Only readout the <option>'s or choose one an select it (set it selected)?

Readout and select them is doable with TCppWebBrowser.

Clicking such a 'button' well at the moment I do not know.

I still ask you to produce an url where we can try it out.
You could make such a page yourself to begin with and place
it on the internet.

If the page is part of a frame then things are more complicated
as then you have to make used functions recursive.

Hans.
Re: Internet Programming
#1413
Author: Eduardo Jauch
Date: Wed, 31 Jan 2007 13:37
72 lines
3628 bytes
Hans Galema escreveu:
> Eduardo Jauch wrote:
> 
>> <select name="mesDisponivel" class="combo-box" onChange="javascript: 
>> popularListaDiasDisponiveis();" >

> You see it has a name atribute "mesDisponivel". You can use the name
> to find the select and then query its <option> ... </option>'s.
> 

   I was reading the help about CppWebBrowser. How can I find the 
select? Is using the "Document" property? I alread bookmarked the 
Microsoft section for Dynamic HTML page on web (the help says to take a 
look to it...)

   In any case, I'll take a look in other posts here to know how to use it.

>> /* THREE BUTTONS */
>>
>> <a href="javascript: confirmarAgendamento();"><img 
>> src="/agendamento-web/images/pt_BR/bt_confirmar.gif" 
>> border="0"></a>&nbsp;
> 
> That construction 'behaves' like a button. In fact is is an image as
> you can see. Where the link is actually javascript, executed
> when the user clicks the image, that calls the function
> confirmarAgendamento();
> 
> Only readout the <option>'s or choose one an select it (set it selected)?
 > Readout and select them is doable with TCppWebBrowser.
 >
 > Clicking such a 'button' well at the moment I do not know.

   In fact, what I need is for exemple, read the content of the combo 
(select). If i find the right option (like a specific month), I need to 
execute the javascript... I don't know if is needed to "select" the 
month in combo, or if I can excute the java script function and pass 
direct to her the argument the it need to know what option I want...

   Anyway, How can I execute a javascript function?

> 
> I still ask you to produce an url where we can try it out.
> You could make such a page yourself to begin with and place
> it on the internet.
> 

   I will try. :)
   I know nothing about java script, so it may take a while until I get 
a page that behave like that I will work.
   But I'll do my best ;)
   (great opportunity to learn something new)

> If the page is part of a frame then things are more complicated
> as then you have to make used functions recursive.
> 
> Hans.

   Yes. The page is a frame within other page.

   I look to one post Help with "TCppWebBrowser - Find and click a 
button" at the Web newsgroup and think that i get on eIdea of what 
you're talking...

Yet, all the code looks "alien" to me...
hauhuahuahuahua

I'll need to take a seat and a good look on the help, examples and other 
  posts here to make me confortable and begin with some easy tests, like 
READ and SHOW the page with TCPPWebBrowser for now ;)

Thanks :)
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads