Help i can't found the xpath to continue

ptcsite46

New Member
Joined
Jan 14, 2024
Messages
7
Office Version
  1. 2016
Platform
  1. Windows
I'm getting an error in the part red colored... The date will be selected (3 months) and the ARA (SEARCH) button will be clicked...

HTML:
<div id="mCSB_1_container" class="mCSB_container mCS_y_hidden mCS_no_scrollbar_y" style="position:relative; top:0; left:0;" dir="ltr">
                            <!---->
                            
                                <a class="filter-singledropselect" href="#" code="0">Bugün</a>
                            
                                <a class="filter-singledropselect" href="#" code="1">Dün</a>
                            
                                <a class="filter-singledropselect" href="#" code="365">Son 1 yıl</a><a class="filter-singledropselect" href="#" code="30">Son 1 ay</a>
                            
                                <a class="filter-singledropselect" href="#" code="7">Son 1 hafta</a>
                            
                                <a class="filter-singledropselect selected" href="#" code="90">Son 3 ay</a>
                            
                                <a class="filter-singledropselect" href="#" code="180">Son 6 ay</a>
                            
                                
                            
                        </div>



XML:
Public Sub cap_Financial_Reported()
Dim connect As New Selenium.ChromeDriver
Dim date As Selenium.WebElement
Dim dates As Selenium.WebElements

Set connect = New Selenium.ChromeDriver
baglan.get "https://www.kap.org.tr/tr/bildirim-sorgu"
connect.Wait 1500

'Notification Criteria
Click on the 'Notification Type menu'
connect.FindElementByXPath("//*[@id='email-form']/div[4]/div[1]/isteven-multi-select/span").Click
connect.Wait 1000
'Select Reporting Type Financial Reports
connect.FindElementByXPath("//*[@id='email-form']/div[4]/div[1]/isteven-multi-select/span/div/div[2]/div[2]/div /label/span").Click
connect.Wait 1000

'Notification Criteria
'Click on the topic menu
connect.FindElementByXPath("//*[@id='email-form']/div[4]/div[4]/isteven-multi-select/span/button").Click
connect.Wait 1000
'Select Notification Type Activity Report
connect.FindElementByXPath("//*[@id='email-form']/div[4]/div[4]/isteven-multi-select/span/div/div[2]/div[2]") .Click
connect.Wait 1000



'Notification Submission Date Criteria
'Date Range (this code is a little different from the others because the element to be clicked is covered by another element. That's why we open it with the code at the beginning
             connect.FindElementByXPath ("//*[@id='email-form']/div[6]/div[1]/div[2]/div")
             connect.Wait 3000
'Select last 3 months
             link.FindElementByXPath ("/html/body/div[7]/div/div/div/div[2]/div[1]/div/div[1]/form/div[6]/div[1]/ div[2]/div/div[1]/div/a[5]")
             connect.Wait 1000




Click on the 'SEARCH Button'
connect.FindElementByXPath("//*[@id='email-form']/a[1]").Click
connect.Wait 2000
End Sub
 

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.
@ptcsite46
If you want to post normal VBA code, paste the code, select the code and click the
1705266073071.png
icon

If you want to post VBA code with manual formatting i.e. extra colour, paste the code, select the code and click the
1705266203742.png
icon
 
Upvote 0
Tahnk you
Rich (BB code):
Public Sub cap_Financial_Reported()
Dim connect As New Selenium.ChromeDriver
Dim date As Selenium.WebElement
Dim dates As Selenium.WebElements

Set connect = New Selenium.ChromeDriver
baglan.get "https://www.kap.org.tr/tr/bildirim-sorgu"
connect.Wait 1500

'Notification Criteria
Click on the 'Notification Type menu'
connect.FindElementByXPath("//*[@id='email-form']/div[4]/div[1]/isteven-multi-select/span").Click
connect.Wait 1000
'Select Reporting Type Financial Reports
connect.FindElementByXPath("//*[@id='email-form']/div[4]/div[1]/isteven-multi-select/span/div/div[2]/div[2]/div /label/span").Click
connect.Wait 1000

'Notification Criteria
'Click on the topic menu
connect.FindElementByXPath("//*[@id='email-form']/div[4]/div[4]/isteven-multi-select/span/button").Click
connect.Wait 1000
'Select Notification Type Activity Report
connect.FindElementByXPath("//*[@id='email-form']/div[4]/div[4]/isteven-multi-select/span/div/div[2]/div[2]") .Click
connect.Wait 1000



'Notification Submission Date Criteria
'Date Range (this code is a little different from the others because the element to be clicked is covered by another element. That's why we open it with the code at the beginning
             connect.FindElementByXPath ("//*[@id='email-form']/div[6]/div[1]/div[2]/div")
             connect.Wait 3000
'Select 3 months later
             link.FindElementByXPath ("/html/body/div[7]/div/div/div/div[2]/div[1]/div/div[1]/form/div[6]/div[1]/ div[2]/div/div[1]/div/a[5]")  'Cant select the 3 ay sonra (means 3 months later)
             connect.Wait 1000


Click on the 'SEARCH Button'
connect.FindElementByXPath("//*[@id='email-form']/a[1]").Click
connect.Wait 2000
End Sub
 
Upvote 0

Forum statistics

Threads
1,223,214
Messages
6,170,772
Members
452,353
Latest member
strainu

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