- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在尝试自动填写重复且耗时的 IE 站点。
我编写了启动 IE 的代码,使其对用户可见,并调暗了需要填写的变量。
我找到了文本框的 ID 和名称,但无法填写。
该网站是一个公司网站,因此我无法附加链接。
我可以附加我要填充的框和我要单击的按钮的 HTLM 代码。
文本框
<input name="ctl00$m$g_8fbfd2b6_3945_4bee_9a3b_20cfc2c846af$ctl00$grdLineItems$ctl02$txtDescription"
type="text"
id="ctl00_m_g_8fbfd2b6_3945_4bee_9a3b_20cfc2c846af_ctl00_grdLineItems_ctl02_txtDescription"
class="txtDescription"
onkeydown="return (event.keyCode!=13);"
style="width:680px;margin-top:2px;margin-bottom:2px" />
点击按钮
<input type="submit"
name="ctl00$m$g_8fbfd2b6_3945_4bee_9a3b_20cfc2c846af$ctl00$ButtonAdd"
value="Add New Item"
id="ctl00_m_g_8fbfd2b6_3945_4bee_9a3b_20cfc2c846af_ctl00_ButtonAdd"
style="color:Black;background-color:White;font-size:Medium;font-weight:bold;width:150px;"/>
我尝试了不同的方法。我尝试按名称获取文本框,但文档命令出现错误。
我的代码
Sub Fill_in_eShipper()
Dim IE As Object Dim web_address As String
Dim number_of_elements As Integer
Dim MydataSet As Variant
Dim ObjCollection As Object
Windows("eshipper filler.xlsm").Activate
Set IE = CreateObject("InternetExplorer.Application")
web_address = Range("c2") Range("D2").Formula = "=ROWS(A1:A161)-1"
number_of_elements = Range("d2")
IE.navigate web_address
IE.Visible = True
While IE.Busy DoEvents 'Wait till IE is done loading Wend
'Number of elements to populate
Range("A1").Select
Range(Selection, Selection.End(xlDown)).Select
Range("D1").Select
ActiveCell.FormulaR1C1 = "=ROWS(RC[-3]:R[160]C[-3])-1"
IE.document.getelementsbyid("ctl00_m_g_8fbfd2b6_3945_4bee_9a3b_20cfc2c846af_ctl00_grdLineItems_ctl02_txtDescription").Value = Range("A2")
IE.document.All("ctl00$m$g_8fbfd2b6_3945_4bee_9a3b_20cfc2c846af$ctl00$ButtonAdd").Click
End Sub
最佳答案
尝试 - 将 Elements
更改为 Element
,并继续使用 .getElementById
进行点击。
IE.document.getElementById("ctl00_m_g_8fbfd2b6_3945_4bee_9a3b_20cfc2c846af_ctl00_grdLineItems_ctl02_txtDescription").Value = Range("A2")
IE.document.getElementById("ctl00_m_g_8fbfd2b6_3945_4bee_9a3b_20cfc2c846af_ctl00_ButtonAdd").Click
关于excel - 在IE窗口中填写表单: Press buttons and fill in text boxes,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52743508/
我在按下按钮后制作了一个扩展表单,但现在我也想添加 Enter 按键,但我不知道如何操作。也许有人可以帮助我!? 代码 $(document).ready( function() {
基本上我使用的是 z-index,通过单击按钮,它应该拍摄背面照片并将其置于正面,反之亦然。我目前正试图让按钮正常工作。 Lab 5, Part 1
这个问题已经有答案了: AlertDialog OnBackPressed() Not Working Properly (3 个回答) 已关闭 4 年前。 我想实现抽屉导航后按对话框上的对话框后按。
我有一个点击功能,长按同一个按钮。实现了长按事件,但我需要分别找到按钮 UP_EVENT 和 DOWN_EVENTS。如何使用 OnLongClickListener 实现 View.OnLongC
我需要简单地检测每时每刻在我的 Qt5/C++ 应用程序中何时按下或释放右键。 到目前为止,我已经编写了这些函数: void test::mousePressEvent(QMouseEvent *ev
我有一个输入框和它下面的“添加”按钮。添加按钮基本上所做的是,它将一个新的输入字段附加到文档中。我在这里尝试做的是,在输入字段中键入时,如果检测到返回键按下,调用添加新输入字段的函数将被触发,与单击添
我正在使用 Java swing 和 Matlab 开发一个项目。我有一个带有 2 个按钮“运行”和“暂停”的 GUI。我正在使用另外一个 java 程序 (Matlabjavaprog.java),
目前,我有一个带有 9 补丁图像作为边框的自定义 View 。 该自定义 View 在 LinearLayout 中放置了三次,所以它看起来像这样: +------------------------
我正打算用一个 TButtonedEdit 控件替换 TEdit + TButton 组合,但当我尝试测试它时,我发现无法使用键盘“按下”(右)按钮。 我尝试了 Alt+Enter、Alt+Down、
您好,我在模糊()和回车键上执行相同的代码时遇到了一些麻烦。我使用以下代码: $(".formatted-date").bind('blur keyup',function(e) { if
这是一个关于android java编程的一般问题。 有没有办法(当手机锁定时)检测是否按下主页按钮几秒钟? 最佳答案 由于不需要硬件按钮,因此并非所有手机都可以使用主页。 关于java - 手机锁定
我在 Pane 中有一个 ImageView,并且该 Pane 已设置 MouseEventHandler 来执行一些操作。 ImageView 的图像在 CSS 文件中定义如下: .imageVie
我需要以编程方式从交互功能内部按下一个键。以下是我目前所掌握的内容的概要: (defun answer-to-life-the-universe-and-everything () (intera
我正在尝试做一个简单的选择器。 这是我的选择器 xml 代码,名为“butt.xml”: 这就是布局: 这就是代码: ImageButton ib; @Override public vo
基本上我是在调用 API 来检索慈善机构列表。然后我将所有这些放在一个数组中并动态设置 UIButtons。 然后我允许用户选择慈善机构并显示包含该索引数据的 View 。 我的循环在这里; for
让我解释更多细节。 首先;我知道如果用户按回键并返回上一个 Activity ,则上一个 Activity 会正确触发 onResume 方法。这没关系。 我的应用程序中有一个根 Activity ,
我正在使用 BootStrap Group Button 类,发现在我自己的代码中,如果按下一个按钮,该按钮将在几秒钟后弹出.... 如何确保它保持按下状态? Stage
我有一个 ListView,当通过 onItemClick 监听器单击项目行时,它会打开另一个 Activity 。 我希望该行从被点击到屏幕切换到新 Activity 时一直保持按下状态。我认为这对
我正在使用 Hammer.JS 来检查事件。我想长按做一些事情。所以我正在使用像这样的锤子新闻事件 var mc = new Hammer(can); mc.on("press", function
我构建了一个 Swing GUI 应用程序,除了一些细节之外,一切都运行良好:我有两个按钮,每个按钮都附加了一个鼠标单击事件。问题是,当我单击它们时,它们保持“按下”状态:其他一切都正常,但看到这两个
我是一名优秀的程序员,十分优秀!