select vba 网页 翻页_使用vba从网页的下拉列表中选择值

该博客介绍了如何使用VBA代码自动填写网页中的国家和语言选择,特别是针对那些需要处理隐藏字段的网站。示例代码展示了如何定位并选择正确的下拉选项,以及处理页面提交后可能出现的问题。
摘要由CSDN通过智能技术生成

On this site I am able to select the country and language from dropdown menu but when I click on "Complete new application form" button. It says fields are empty.

Any help would be appreciated.

Sub Test()

strURL = "https://visa.kdmid.ru/PetitionChoice.aspx"

With ie

.Visible = True

.navigate strURL

While .Busy

DoEvents

Wend

Set html = .document

'Country where you will apply for visa.

Set ctY = html.getElementById("ctl00$phBody$Country")

For i = 1 To ctY.Options.Length

If ctY.Options(i).Text = "NETHERLANDS" Then

ctY.selectedIndex = i

Exit For

End If

Next i

'Select Language

Set lnG = html.getElementById("ctl00$phBody$ddlLanguage")

For i = 1

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值