Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/xamarin/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Excel 如何设置输入名称的值";PickupDate";使用VBA?_Excel_Vba_Web Scraping - Fatal编程技术网

Excel 如何设置输入名称的值";PickupDate";使用VBA?

Excel 如何设置输入名称的值";PickupDate";使用VBA?,excel,vba,web-scraping,Excel,Vba,Web Scraping,我尝试了以下代码,但获得了一个对象错误: Dim g As IHTMLElement Set g = appIE.getElementsByName("PickupDate") g.Value = b <div class="date date-time-field" id="pickup-date"> <div class="date-icon icon"></div> <input name="PickupDate" c

我尝试了以下代码,但获得了一个对象错误:

Dim g As IHTMLElement

Set g = appIE.getElementsByName("PickupDate")
    g.Value = b

<div class="date date-time-field" id="pickup-date">
    <div class="date-icon icon"></div> 
    <input name="PickupDate" class="short picker__input" id="P666421526" aria-expanded="false" aria-haspopup="true" aria-readonly="false" aria-owns="P666421526_root" type="text" readonly="" placeholder="Date">
                                    </div>
Dim g作为IHTMlement
Set g=appIE.getElementsByName(“PickupDate”)
g、 值=b
试一试:

对于特定值:

Set post = html.getElementsByName("PickupDate")
MsgBox post(0).ID
通过多个值循环:

For Each post In html.getElementsByName("PickupDate")
    MsgBox post.ID
Next post

这是预期的输出吗
p66421526
?@shahin是,这将是输出,但该ID的值会更改。我正在尝试在日期选择器中设置日期。我知道该值将随不同ID而更改。过一会儿我会发布一个答案。