Results 1 to 7 of 7
  1. #1
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts

    click on 'Cerca' in web page (6.0)

    This is a part of my code... I want to click on button "Cerca", how to?
    tks.

    Option Explicit
    Dim oIE As Object
    Sub tempsadf()

    Dim URL As String
    Dim intCount As Integer
    Dim itm As Variant
    Dim varTemp As Variant

    Set oIE = CreateObject("InternetExplorer.Application")

    URL = "http://www.bpp.it/AbiCab/RicercaAbiCab.asp"

    oIE.Visible = True

    oIE.navigate (URL)

    Do While oIE.readyState <> 4 And oIE.Busy

    DoEvents

    Loop

    oIE.document.all.Item("abitxt").Value = "1005"

    oIE.document.all.Item("cabtxt").Value = "3401"

    code to clcik "Cerca" here

    End Sub

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: click on 'Cerca' in web page (6.0)

    How about

    oIE.document.all.Item("Cerca").Click

  3. #3
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: click on 'Cerca' in web page (6.0)

    ok wORK FINE..!!!!
    The real button name is "btcercacab"...

    But used this (big your code!!!!)
    How to get data after insert 1005 and 3401 and press Cerca

    Not intercept the row and cell... in item(3)
    Make only TEST_TAG_1 the rest i understand my self

    TEST_TAG_1 = UCase(.document.all.tags("table").Item(3).Rows(0). Cells(3).innerText)
    Range("C" & lngRow) = UCase(.document.all.tags("table").Item(3).Rows(0). Cells(3).innerText)
    TEST_TAG_2 = UCase(.document.all.tags("table").Item(3).Rows(1). Cells(3).innerText)
    Range("D" & lngRow) = UCase(.document.all.tags("table").Item(3).Rows(1). Cells(3).innerText)
    TEST_TAG_3 = UCase(.document.all.tags("table").Item(3).Rows(2). Cells(1).innerText)
    Range("E" & lngRow) = UCase(.document.all.tags("table").Item(3).Rows(2). Cells(1).innerText)
    TEST_TAG_4 = UCase(.document.all.tags("table").Item(3).Rows(3). Cells(1).innerText)
    Range("F" & lngRow) = UCase(.document.all.tags("table").Item(3).Rows(3). Cells(1).innerText)
    TEST_TAG_5 = Format(UCase(.document.all.tags("table").Item(3).R ows(4).Cells(1).innerText), "#00000")
    Range("G" & lngRow) = Format(UCase(.document.all.tags("table").Item(3).R ows(4).Cells(1).innerText), "#00000")

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: click on 'Cerca' in web page (6.0)

    Sorry, I don't understand your question.

  5. #5
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: click on 'Cerca' in web page (6.0)

    now....
    Solved the first part of post.
    In web page:http://www.bpp.it/AbiCab/RicercaAbiCab.asp

    For test insert 1005 in ABI and 3401 in CAB
    Press Ceca...
    Appear a new windows with result of searching...
    I want to get data with the line posted here but cannot intercept the correct Item row and cell to get data...
    Make for me only example for first line where is the value of ABI and the value of BANCA
    Tks for patience

  6. #6
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: click on 'Cerca' in web page (6.0)

    You'll have to analyze the source code of the page to find out which table contains the data you need. I'm not going to do that for you.

  7. #7
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: click on 'Cerca' in web page (6.0)

    (Edited by jscher2000 on 10-Dec-07 18:36. See the additional note.)

    Sometimes the table structure is extremely complicated. For one example of code to read HTML tables, you could review these threads:

    Screen scraper (Access 2003 SP1) (post #532341)
    Screen scraper cont... (IE6) (post #536011)

    Added: In the case of your page, you could retrieve a collection of all the tables (pardon any syntax confusion, I mostly do this in JavaScript):

    <code>colTables = document.getElementsByTagName("table")</code>

    Then for each table, check the first cell in each row until you find "ABI" and then you can work from there.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •