How to fill web page ??

How to fill web page ??

Postby vilian » Fri Aug 21, 2015 12:33 pm

Hi Guys,

I have a web page (see the image bellow) that i need select an item of the radio
Image

I'm using oAct:=TActiveX():New(oWndEdt,"Shell.Explorer.2") To navigate at this page, but don´t have sucess in select a item :(

The source code of the radio item in page is:
Code: Select all  Expand view

<tr><td class="box">
    <input type="radio" name="grupo_radio" value="10101198">
    <input type="hidden" value="0.0" name="proc_valor2"></td>
       </td>
       <td class="codigo">10101198</td>
       <td class="descricao">Consulta ao cardiologista (Parecer cardiológico)</td>
</tr>


I have already tested:
oAct:Document():All:Item("grupo_radio",0):Value := "10101198"
and
oAct:Document():All:Item("proc_valor2",0):Click()
and
oAct:Document():All:Item("proc_valor2",0):Checked := .t.
and
oAct:Document():All:Item("proc_valor2",0):value := 1

But nothing happens :(

Help me, please !!!!
Sds,
Vilian F. Arraes
vilian@vfatec.com.br
Belém-Pa-Brazil
User avatar
vilian
 
Posts: 920
Joined: Wed Nov 09, 2005 2:17 am
Location: Brazil

Re: How to fill web page ??

Postby Rick Lipkin » Fri Aug 21, 2015 8:04 pm

Vilian

You need to look at the 'view source' to see the html .. I recommend finding a good Html Source code viewer .. I did a quick search :
http://sourceforge.net/projects/scv/

The viewer will show you the IDs of every control and that is what you need to reference in your code. Been a while since I scraped web pages .. if you need more help, give me a shout

Rick Lipkin
User avatar
Rick Lipkin
 
Posts: 2618
Joined: Fri Oct 07, 2005 1:50 pm
Location: Columbia, South Carolina USA

Re: How to fill web page ??

Postby Kleyber » Fri Aug 21, 2015 8:25 pm

Vilian,

Take a look at viewtopic.php?f=6&t=31216&start=15. Maybe it can show you a way.
Kleyber Derick

FWH / xHb / xDevStudio / SQLLIB
User avatar
Kleyber
 
Posts: 581
Joined: Tue Oct 11, 2005 11:28 am
Location: São Luiz, Brasil

Re: How to fill web page ??

Postby Carlos Mora » Sat Aug 22, 2015 8:38 am

Hi Vilian,
vilian wrote:I'm using oAct:=TActiveX():New(oWndEdt,"Shell.Explorer.2") To navigate at this page, but don´t have sucess in select a item :(

The source code of the radio item in page is:
Code: Select all  Expand view

<tr><td class="box">
    <input type="radio" name="grupo_radio" value="10101198">
    <input type="hidden" value="0.0" name="proc_valor2"></td>
       </td>
       <td class="codigo">10101198</td>
       <td class="descricao">Consulta ao cardiologista (Parecer cardiológico)</td>
</tr>


I have already tested:
oAct:Document():All:Item("grupo_radio",0):Value := "10101198"
and
oAct:Document():All:Item("proc_valor2",0):Click()
and
oAct:Document():All:Item("proc_valor2",0):Checked := .t.
and
oAct:Document():All:Item("proc_valor2",0):value := 1



Would you please post the whole radio code? Please copy the whole TABLE code, there will be more information there. There should be more than just a single radio, but three, and all of them with name="grupo_radio", so
Code: Select all  Expand view
:All:Item("grupo_radio",0)
is probably an array, not just a single element. If I'm right, we can try oAct:Document():All:Item("grupo_radio",0)[3]:Checked:= .T. .
Forget about proc_valor2, at least for now. It's a hidden input, so it is of type 'text'. Probably you will find other hidden inputs called proc_valor(?) associated with their corresponding radiobuttons, and some javascript code that make some kind of trick changing it's value, but by now let's fix the 1st radio issue.

Follow Rick's advice: Inspect the code in Chrome (right-click on any element), it has a nice object inspector, or try FireBug (my choice) in Firefox.
Saludos
Carlos Mora
http://harbouradvisor.blogspot.com/
StackOverflow http://stackoverflow.com/users/549761/carlos-mora
“If you think education is expensive, try ignorance"
Carlos Mora
 
Posts: 988
Joined: Thu Nov 24, 2005 3:01 pm
Location: Madrid, España

Re: How to fill web page ??(SOLVED)

Postby vilian » Mon Aug 24, 2015 10:55 am

Thanks Guys,

The problem was solved changing the code for this:

nPos := 4
oAct:Document():All:Item("grupo_radio",nPos):Checked := "true"
Sds,
Vilian F. Arraes
vilian@vfatec.com.br
Belém-Pa-Brazil
User avatar
vilian
 
Posts: 920
Joined: Wed Nov 09, 2005 2:17 am
Location: Brazil


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 82 guests

cron