excel vba ile iWorkBetter altyapısı kullanılan bir sitede seçim işlemi yapmak..

fkalelinet

New Member
Joined
Nov 25, 2021
Messages
3
Office Version
  1. 2019
Platform
  1. Windows
Üzerinde çalıştığım site iWorkBetter altyapısı kullanılan yapılmış. dolayısıyla internet explorer vba kullanmakta sorunlar yaşıyorum.. bilgisayarda selenium varken aşağıdaki kod ile seçim yapabiliyordum ancak şuan selenium kullanmam mümkün değil. dolayısıyla sadece excel vba ve ie tarayıcı üzerinden işlem yapmam gerekiyor. bir çok işlemi de yaptım yapıyorum.
site giriş kullanıcı adı paralo ilgili değer girilecek tablar arası geçişi de yapıp hatta değerleri bir yere kadar girip kayıt da yapabiliyorum ancak bazı sayfalardaki altalta olan tabloları seçmem ve sonrasında o seçili kısım üzerinde işleme devam etmem gerekiyor. burada takılı kaldım..
sayfa böyle açılıyor ve tr-b seçili geliyor bununla ilgili işlemleri bitirince

tr-b seçili.png

alttaki tabloda herhangi bir yere tıklayınca seçim mavi oluyor ve tr-a seçiliyor.

Ekran görüntüsü 2021-11-25 202723.png


Daha önce selenium ile seçip üzerinde işlem yapabildiğim vba kodları şu şekilde.

VBA Code:
With Driver

.FindElementByXPath("//div[text()='TR-A']").Click
    Sleep 1000
                  
'On Error Resume Next
'Do While Driver.FindElementByXPath("(//table[contains(@id,'btn_add_tpi')])[1]") Is Nothing
'DoEvents
'Loop
'On Error GoTo 0
                
'#### DEĞER EKLE #####

.FindElementByXPath("(//table[contains(@id,'btn_add_tpi')])[1]").Click
    Sleep 1000
  End With


internet explorer ile yapmaya çalıştığım denediğim bazı kodlar da bu şekilde..




Code:
IE.Document.getElementByClassName("x-grid3-cell-inner x-grid3-col-rumuz").FireEvent ("onclick")

Set divs = IE.Document.getElementsByTagName("div")
For Each div In divs
    If div.innerText = "TR-A" Then div.FireEvent ("onclick")
Next

Set HTMLInput = IE.getElementsByClassName("x-grid3-col x-grid3-cell x-grid3-td-degisti x-grid3-cell-first ")(1)
HTMLInput.Click
Sleep 1000


Call IE.Document.getElementByClassName("x-grid3-cell-inner x-grid3-col-rumuz").setAttribute("unselectable", "off")

'Replace$(IE.Document.getElementByClassName("x-grid3-cell-inner x-grid3-col-rumuz").innerHTML, "unselectable=""on""","unselectable=""off""")

IE.Document.getElementsByClassName("x-grid3-row-table")(0).Click
Sleep 3000

'IE.Document.getElementsByClassName("x-grid3-cell-inner x-grid3-col-marka")(0).Click
'Sleep 1000

Set objCollection = IE.Document.getElementsByTagName("div")
    i = 0
    Do While i < objCollection.Length
    If Left(objCollection(i).innerText, 4) = "1ZTR" Then
'FnWait (2)
Sleep 1000
    objCollection(i).Click
    Exit Do
    End If
    i = i + 1
    Loop
While IE.Busy Or IE.ReadyState < 4: DoEvents: Wend
'FnWait (2)
Sleep 1000

IE.Document.querySelector("[_nodup='30806'][viewindex='0']").FireEvent "ondblclick"

orjinal sayfa kodları da şöyle..

Ekran görüntüsü 2021-11-25 204027.png


yardımlarınızı bekliyorum. saygılarımla...
 

Excel Facts

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.

Forum statistics

Threads
1,215,646
Messages
6,126,004
Members
449,279
Latest member
Faraz5023

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top