Tag: 互联网浏览器

与IE标签交互一旦打开

我在这里要做的是在不同的IE选项卡中同时自动打开几个帮助台票据。 我在Excel中创build一个票号列表,然后循环显示票号,打开每个号码。 我的代码似乎工作正常,当我打开每个单独的IE实例,但由于我试图打开它们在一个IE实例的单独的选项卡中,我得到第二个循环的错误。 这是我到目前为止: Set Tickets = Sheet5.Range("a1", Range("a1").End(xlDown)) Set ie = New InternetExplorerMedium ie.Visible = 1 apiShowWindow ie.hwnd, SW_MAXIMIZE For Each Ticket In Tickets If Ticket <> "" And Not Ticket Like "IM*" And Not Ticket Like "ARS*" And Not Ticket Like "C*" Then 'Load Mantis Page If Tabbed = False Then ie.Navigate "http://URL" […]

在Internet Explorer中使用vba从combobox中select项目

以下值表示网站上的combobox/组合列表。 我正在尝试使用VBA从下拉菜单中select项目#3。 我已经尝试了几件事情,但是我没有select上述项目的运气。 我曾尝试寻找谷歌和堆栈上的解决scheme,但没有发现任何似乎工作。 <DIV id=ext-gen256 class="x-layer x-combo-list x-combo-list-small" style="FONT-SIZE: 10px; HEIGHT: 92px; WIDTH: 113px; POSITION: absolute; LEFT: 744px; Z-INDEX: 12007; TOP: 235px; VISIBILITY: visible"> <DIV id=ext-gen257 class=x-combo-list-inner style="HEIGHT: 90px; WIDTH: 111px"> <DIV class="x-combo-list-item" _nodup="30829" viewIndex="0">Select</DIV> <DIV class="x-combo-list-item" _nodup="30829" viewIndex="1">Item 1</DIV> <DIV class="x-combo-list-item" _nodup="30829" viewIndex="2">Item 2</DIV> <DIV class=""x-combo-list-item" _nodup="30829" viewIndex="3">Item 3</DIV> <DIV class="x-combo-list-item" _nodup="30829" viewIndex="4">Item […]

使用excel vba更改下拉菜单的值,然后激活并填充第二个下拉菜单

我正在写一个macros的excel来填写一个网站的表格。 我的问题是,我可以确定下拉菜单(是一个select命令),但是这应该激活并填充第二个下拉菜单..没有出现 代码是 “这是第一个select地区的select <select name="ctl00$cp$ddlRegion" id="ctl00_cp_ddlRegion"> <option value="">seleziona…</option> <option value="13">Abruzzo</option> <option value="17">Basilicata</option> <option value="18">Calabria</option> <option value="15">Campania</option> <option value="08">Emilia-Romagna</option> <option value="06">Friuli-Venezia Giulia</option> <option value="12">Lazio</option> <option value="07">Liguria</option> <option value="03">Lombardia</option> </select> “第二select,从上面的地区看,稳定城市 <select name="ctl00$cp$ddlProvince" id="ctl00_cp_ddlProvince"> <option value="">seleziona…</option> <option value="070">Campobasso</option> <option value="094">Isernia</option> </select> 我的代码是: IE.document.ALL("ctl00$cp$ddlRegion").Value = "03" ' that is LOMBARDIA 但在此行后面显示的值..但第二个select不激活。 我曾尝试过 IE.document.ALL("ctl00$cp$ddlRegion").focus IE.document.ALL("ctl00$cp$ddlRegion").click IE.document.ALL("ctl00$cp$ddlRegion").fireEvent ("onchange") IE.document.ALL("ctl00$cp$ddlProvince").focus […]

Excel VBA和IE 11 – 在下拉菜单中select值后无法刷新页面

我正在尝试获得WorldRemit为一对货币提供的货币汇率。 我想要更改网页左上angular“发送自”下拉列表中的值。 ( https://www.worldremit.com/en/South-Africa ) 我无法使用.Selected = True或.Selected = Trueselect下拉选项,因此使用了.SelectedIndex 。 select该值后,我无法触发刷新页面的更改事件。 如果有人能帮我弄明白这一点,那会很棒。 导航到页面的代码: Set ie = CreateObject("InternetExplorer.Application") ie.Visible = True ie.navigate "https://www.worldremit.com/en/South-Africa" While ie.busy DoEvents Wend Set HTMLdoc = ie.document 使用.SelectedIndex属性select选项的代码: Dim fromSelect As HTMLSelectElement Set fromSelect = HTMLdoc.getElementById("selectFrom") optionIndex = Find_Select_Option(fromSelect, "Germany") If optionIndex >= 0 Then fromSelect.selectedIndex = optionIndex fromSelect.FireEvent ("onchange") ' […]

从Internet Explorer下拉列表中select选项

我正在打开一个网页并填写一些字段。 我设法填写文本框,但我有麻烦从下拉列表中select检查/select单选button的选项。 这是引用下拉列表的HTML代码: 下拉列表的HTML代码 这是一个单选button的代码 :单选button的HTML代码 这是我的代码到目前为止: Sub w() ' ' w Macro ' ' Keyboard Shortcut: Ctrl+w ' 'pick ups cell b2 value Dim cellvalue As String cellvalue = ActiveSheet.Cells(1, 2) Dim HTMLDoc As HTMLDocument Dim oBrowser As InternetExplorer ''Sub Login_2_Website() Dim oHTML_Element As IHTMLElement Dim sURL As String On Error GoTo Err_Clear sURL […]

在IE中用excelmacros,多个名称元素填充文本框

我试图从我的excelsheet中input一个值到IE中的文本框。 到现在为止,我成功地打开了正确的网站。 Set IE = New InternetExplorerMedium IE.navigate "http://test.com" 'dummysite IE.Visible = True IE.document.GetElementsByName("value") = "value from sheet" 要填充文本框中的某个元素,需要给出一个名为“value”的元素。 问题是这个元素名称“值”在网站的代码中多次出现。 我试过类似的东西(因为它是名为value的第七个元素), IE.document.GetElementsByName("value")(7) = "value from sheet" 但是这也行不通。 这是网站来源的一部分。 我正在尝试填写第二行的值元素。 <td> <input name="@_20_0_T" type="hidden" value="T_AN"> <input name="_20_0_T" type="text" size="40" value=""> </td>

尝试使用VBA与DOM元素input进行交互

我的问题是试图与使用VBA的网站进行交互。 我已经处理填充input框通过简单地说ie.document.getElementById(strId).value = my_value以及当这些元素存在于一个ie.document.getElementById(strId).value = my_value体内。 但是对于我的生活,我无法得到这个工作。 我会尽我所能发布尽可能多的HTML。 HTML: <input title="Order Number" class="mtn-srch-text text-field req" id="orderNum" type="text" maxLength="10" data-sticky-placeholder="Order Number"> 试图采取orderNum字段并填写它的VBA。 objBrowser.document.getElementById("orderNum").value = "1234" 对象每次都要求错误,所以我认为它不在正确的位置,因为元素肯定存在,但是我错误地指向它。 由于在此页面的HTML中没有看到任何表单标签,因此我不知道如何继续深入查看以填充此input框。 任何build议将是真棒! 添加一些更多的代码,不得不删除一些URLS和用户名/密码,但是你可以看到,导航很简单,直到我们到达它的iFrames部分。 我现在看到每个iFrame有一个不同的SRC,这可能是为什么 .contentDocument.getelementbyId("textbox").value = "test" 不会工作。 我们所关注的是虚线以下的所有东西,正如你所看到的那样,我只是在四处尝试不同的东西。 Dim strPosUrl As String, strUsername As String, strPassword As String, _ strStoreDomId As String, strStore As String, _ strBtnStoreUpdateDomId As String, […]

网页上的Excel VBA:不填写textarea

我很难过 我试图用vba来填写描述文本区域的文本“嗨”,但我得到错误。 我究竟做错了什么? 以下是网页: http : //toronto.kijiji.ca/c-PostAd?AdVideoUrl=&AddressCity=&AddressCounty=&AddressRegion=&AddressSelectedByUser=false&AddressStreet=&AddressStreetName=&AddressStreetNumber=&AddressZip=&Alley=&CPUrl=&CatId=212&ChangeCategory=&ChangePhoto=&ContactInfo=&Description= &DiscountPrice =&电子邮件=&EpsErrorCode =&EventEndDay = 18&EventEndHour = 23&EventEndMinute = 59&EventEndMonth = 5&EventEndSecond = 3&EventEndYear = 2014&EventStartDay = 18&EventStartHour = 0&EventStartMinute = 0&EventStartMonth = 5&EventStartSecond = 3&EventStartYear = 2014&GetNeighborhood =&的Guid =&JavaScriptNotEnabled =假泳道=&MapAddress =&总数=&PaypalEmailAddress =&PaypalMobileNumber =&电话=&照片= &PhotoDesc =&PostAs = POST_AS_OWNER&PreviewAd =&PreviewToEdit =&价格=&RequestRefererUrl%2C&RoadStreet =&SelectedLeafCat = SelectedLeafCat&ShowPhone =检查&ShowTerms =&子编号=&缩略图=&名称=&TransDescription =&TransTitle =&VinNumber =&WebsiteUrl =&action_cancel […]

通过VBA获取现有的IE

我的目标是将数据从同一网站上的多个网页中截取到Excel中。 我有这些页面在IE8中的标签打开。 我没有其他的IE窗口打开。 我已经尝试了以下来打开IE浏览器: AppActivate "Microsoft Internet Explorer provided by [my company]" ' It loses focus, the titlebar flashes for a fraction of a second ' .. another code .. Dim ShellApp Set ShellApp = CreateObject("Shell.Application") Dim ShellWindows Set ShellWindows = ShellApp.Windows() Dim i For i = 0 To ShellWindows.Count – 1 If InStr(ShellWindows.Item(i).FullName, "iexplore.exe") […]

Excelmacroslogin网站时出错

我有一个macros来打开IE浏览器,login到一个页面,并拉一个表。 这是为我们的路由器,而不是一个网站。 它给我的错误“对象variables或块variables未设置”。 它在debugging器中突出显示黄色的“用户名”行。 这是来自网站的代码部分: <form name="login_form" method="post" style="display:none"> <input type="hidden" name="mode" value="submit" /> <input type="hidden" name="option" value="login" /> <div id="login_box"> <div id="company_name">Copyright &copy; <span id="company_name_text"></span>. All rights reserved.</div> <div id="login_box_layout"> <strong>Login</strong><br><br> Username:<br> <input type="text" class="text_box" name="username" tabindex="1" autocapitalize="off"><br><br> Password:<br> <input type="password" class="text_box" name="password" tabindex="2" autocomplete="off"><br><br> <input type="button" value="Login" tabindex="3" class="submit_action"> <div class="smart_status" id="smart_status"></div> </div> […]