Tag: internet explorer

如何检索VBA中IE字段的值?

我试图从HTML代码中检索“供应商数量”,这是我的失败。 我努力了: Offers = IE.Document.getElementByID("offers") Split(IE.Document.getElementByID("offers") Set Offers = IE.Document.getElementByID("offers").IE.Document.getElementsByTagName("input") Set Offers = IE.Document.getElementByID("offers").IE.Document.getElementsByClassName("col-sm-3") 其次是For…Next语句 所有与.Value,.innerText或(0) 值555是没有这些选项。 我没有任何线索…

如何在Excel VBA Internet Explorer中使用通配符

你能告诉我如何在Excel VBA的Internet Explorer中使用通配符? id="btn_edit_card_1NLQNQD0D93O" 每次在不同的数字。 如何通过点击该button document.getElementById 代码中没有类 <a id="btn_edit_card_1NLQNQD0D93O" href="/trades/bejelentes_egyszerusitett/1NLQNQD0D93O">Editing basic data</a>

当button没有名称/ ID时,单击带有VBA的JSbutton

我不能为我的生活弄清楚如何点击下面的button与VBA。 任何帮助,将不胜感激。 我已经能够填充用户名/密码字段,因为他们有一个名称,所以我使用getElementsByName但button没有名称或ID。 具体的button代码是: <table class="button"><tr><td><div class="button-left"><input type="submit" class="form-button" value="Submit" > 这是完整的脚本/表单代码,以防止它的帮助 <form name="loginFormBean" method="post" action="/XXXXXXXX/login.do" onsubmit="return validateForm(this)"> <TABLE border="0" cellpadding="5" cellspacing="0"> <TR> <TD class="bigGreyContent" nowrap>User ID</TD> <TD class="bigGreyContent" align="left"> <input type="text" name="username" maxlength="50" size="40" value="" class="bgGreenColor"> </TD> </TR> <TR> <TD class="bigGreyContent" nowrap>Password</TD> <TD class="bigGreyContent" align="left"> <input type="password" name="password" maxlength="50" size="40" value="" class="bgGreenColor"> </TD> </TR> […]

用于编写excel文件的Java servlet在IE7 / IE8中导致错误

我有一个jsf应用程序,当用户点击一个button时,有一个支持的bean方法调用这个servlet。 问题是在IE7和IE8中,文件无法下载。 它给出了错误信息: Internet Explorer cannot download ExcelGenerator from mydomain.com 我需要做什么才能在IE7 / IE8中工作? 我是否需要设置一些额外的标题? 调用servlet的backing bean方法: public void generateExcel() { FacesContext context = FacesContext.getCurrentInstance(); String url = context.getExternalContext().getRequestContextPath() + "/ExcelGenerator"; context.getExternalContext().redirect(url); } 生成excel文件的Servlet: public class ExcelGenerator extends HttpServlet { private static final long serialVersionUID = 1L; private static final Logger LOG = LoggerFactory.getLogger(ExcelGenerator.class); @Override public […]

使用VBA自动化IE – 单击带有跨度的锚点button

我目前正在做自动化上传文件在销售队伍。 HTML文本是: <div> <a href="javascript:void(0);" onblur="chatter.getFeed().contentCommentActionBlur(this);" onfocus="chatter.getFeed().contentCommentActionFocus(this);" onclick="chatter.getFeed().createContentComment(this,'0D52700002cc67d', false, true);" onmousedown="chatter.getFeed().contentCommentActionMouseDown(this);" class="cxcontentcommentaction"> <img class="cxcontentcommentactionimg" src="/s.gif"> <span class="cxcontentcommentactiontext">Attach File</span> </a> </div> 点击锚点用户需要下去,然后按“附加文件”button。 我曾尝试过两种不同的做法 1.通过锚类获取元素=“cxcontentcommentaction”: Set htmldoc = mydoc.getElementsByClassName("cxcontentcommentaction") htmldoc.Click 2.通过span class =“cxcontentcommentactiontext”编码获取元素: Set htmldoc = mydoc.getElementsByClassName("cxcontentcommentactiontext") htmldoc.Click 对于我收到错误“对象不支持此属性 您的评论后,我已经尝试过这样, Set oElementCollection = mydoc.getElementsByClassName("cxcontentcommentactiontext") For Each link In oElementCollection If link.innerHTML = "Attach File" Then link.Click Exit […]

VBA脚本与Excel和IE

我试图用列A中的值打开一个.xlsx文件(比方说A1:A1000)。 我需要脚本从A1中select值并将其添加到URL中。 然后需要打开该URL并更改该特定网站上的设置。 然后应该确认更改并继续下一个值A2,直到最后一个值(一个循环)。 我已经拿出他跟随: Set IE = CreateObject("InternetExplorer.Application") IE.Visible = 1 IE.navigate "http://xxxx/edit_product.php?Prod_ID=45306" Do While (IE.Busy) WScript.Sleep 100 Loop Set Helem = IE.document.getElementByID("Status") Helem.Value = "The change I need" Do While (IE.Busy) WScript.Sleep 100 Loop Set Shell = WScript.CreateObject("WScript.Shell") Shell.SendKeys "{TAB}" Shell.SendKeys "{TAB}" Shell.SendKeys "{TAB}" Shell.SendKeys "{TAB}" Shell.SendKeys "{TAB}" Shell.SendKeys "{TAB}" Shell.SendKeys "{TAB}" Shell.SendKeys […]

login到网站

我试图创build一个Excelmacros,将我login到这个网站 。 我写了macros来login到其他网站,但这是不同的。 当我使用以下代码以编程方式插入用户名和密码,然后以编程方式单击“login”button时,网页带有消息 错误:请提供用户名和错误:请提供密码 Sub LogIn() ' Open IE and navigate to the log-in page Set ie = CreateObject("InternetExplorer.Application") With ie .Visible = True .navigate "https://www.prudential.com/login" ' Loop until the page is fully loaded Do Until Not ie.Busy And ie.ReadyState = 4 DoEvents Loop Application.Wait (Now + TimeValue("0:00:10")) ' Enter the necessary information on […]

将工作表添加到用户select的Excel文件中

我正在使用ActiveX对象将工作表添加到用户select的Excel文件。 下面的代码工作。 (这是一个IE修补程序,所以使用ActiveX) var excel = new ActiveXObject("Excel.Application"); var excel_file = excel.Workbooks.Open(path); var ws = excel_file.Worksheets; resultSheet = ws.Add(); 但创build的工作表首先添加,我想添加它现有的工作表在Excel中。 可能吗 ? 我应该将哪些parameter passing给Add方法?

如何用VBA读取IE表格文本?

我正在尝试编写一个vba代码来遵循这个过程: 自动填写网页并提交(一个新的网页打开,答案为http://ec.europa.eu/taxation_customs/vies/?locale=en ) find新网页的地址(因为我需要阅读这个内容) 阅读html表格的特定单元格(公司名称) 您可以尝试手工提交增值税号FR(法国)和27435044714的for。它将返回包含公司名称的页面。 基本上我挣扎着提取公司的名字。 步骤1工作得很好,独立于步骤2和步骤3.步骤2和步骤3在同一个Sub: macros从第2步开始(find打开的网页) Sub recup() Dim SWs As SHDocVw.ShellWindows, IE As SHDocVw.InternetExplorer 'Establish link to IE application Set SWs = New SHDocVw.ShellWindows For Each IE In SWs If Left(IE.LocationURL, 4) <> "http" Then GoTo autre End If Address = IE.LocationURL GoTo vabene 'avoid explorer windows/etc this way autre: Next […]

VBA自动化谷歌search

我正在使用下面提到的VBA脚本自动化谷歌search(只需要英文结果),但得到错误91,PLZbuild议解决scheme。其他要求是我需要非个性化的谷歌search结果 Sub XMLHTTP() Dim url As String, lastRow As Long Dim XMLHTTP As Object, html As Object, objResultDiv As Object, objH3 As Object, link As Object Dim start_time As Date Dim end_time As Date lastRow = Range("A" & Rows.Count).End(xlUp).Row Dim cookie As String Dim result_cookie As String start_time = Time Debug.Print "start_time:" & start_time For […]