【问题标题】:Paste CSV values into several Form fields in any web page将 CSV 值粘贴到任何网页中的多个表单字段中
【发布时间】:2011-02-04 16:42:17
【问题描述】:

问题:

网上有很多不错的科学计算器页面。

某些计算器页面的文本区域很大, 您可以直接粘贴输入的 CSV 值。

但是...一些计算器表格 要求您输入/粘贴每个输入值 到一个单独的表单输入字段!

 [x1] [x2] [x3] ...etc.

如果您想多次输入许多数据点,那会很费力......

看看这个前任。计算器: http://zweigmedia.com/RealWorld/multlinreg.html

另一个例子: http://zweigmedia.com/RealWorld/newgraph/regressionframes.html

看到了吗?您需要单独输入/粘贴每个输入值...

问题:

是否有 BookmarkletAHK Autohotkey 脚本, 这将简单地粘贴许多输入 CSV 值, (可能从 Excel 电子表格或其他数据输入源复制), 到计算器的所有输入表单字段中,AT ONCE?。

如果它是 GENERIC 脚本/bkmlt,这将非常有用, (即:对于网络中的任何此类计算器表格)...

谢谢! SFdude *Win XP SP3*

【问题讨论】:

    标签: bookmarklet paste autohotkey calculator


    【解决方案1】:

    我不知道有任何这样的脚本,但您可以很容易地自己编写一个或聘请某人来做(vworker.com)。方法是使用论坛中的 COM.ahk 模块并将 javascript 发送到浏览器(我知道这至少适用于 IE)。

    不过,必须为每个计算器自定义 javascript。我无法想象一种通用的方法来做到这一点。

    【讨论】:

      【解决方案2】:

      我假设您已经知道如何从 CSV 获取数据。将数据输入到网页中就像解析输入表并输入数据一样简单:

      wb := ComObjCreate("InternetExplorer.Application")
      wb.Navigate("http://zweigmedia.com/RealWorld/multlinreg.html")
      wb.Visible := true
      while wb.busy
          sleep 10
      
      n := 0
      table := wb.document.theForm.all.tags("table")[0]
      
      ; loop through all the rows
      ; skip Row 0 since its headers - A_Index starts at 1 anyways
      Loop % table.rows.length - 1 {
          ; access the cells in the row
          cells := table.rows[A_Index].cells
          ; loop through the cells
          Loop % cells.length
              ; each cell has an input element - access & set the value of this element
              cells[A_Index-1].childNodes[0].value := n++
      }
      

      本例使用 AutoHotkey_L

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2020-07-11
        • 2011-05-26
        • 2020-01-28
        • 1970-01-01
        • 2014-07-04
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多