2014-08-28 240 views
0

我想通过重组网页的CSS或复制到剪贴板快捷方式将值直接发送到剪贴板从网页拉多个值。如何将HTML中的文本值复制到剪贴板?

<fieldset id="property_info"> 
    <legend>Property Information</legend> 
     <table id="prop_table"> 
      <tbody> 
       <tr> 
        <td><label for="street_num">Street Num</label></td> 
        <td><input name="form[street_num]" id="street_num" class="required" value="1223" type="text"></td> 
        <td><input name="form[address1]" id="address1" class="required" value="CABRILLO PARK" type="text"></td> 

例如具有突出页面上的值了,有没有办法,我可以送的“1223”的值,并在同一时间值“CABRILLO PARK”我的剪贴板在AutoHotkey或还要别的吗?要么或重新安排CSS?

+0

这与CSS有什么关系? – Magrangs 2014-08-28 13:47:46

+0

@Magrangs ID属性信息是类,我想知道是否可以安排将CSS的所有输入值一次性扔到剪贴板?我也不太了解,即使这是可能的,这就是为什么我问这个问题,这使我简单的头脑变得难以置信。 – 2014-08-28 13:50:11

+0

好的...你为什么要这么做?听起来有点奇怪的事情! – Magrangs 2014-08-28 13:53:47

回答

0

对于AutoHotkey的,(分号意味着注释):

!2:: ; !2 means alt 2, change convenient key combination 
file_containing_example_html_you_posted:="http://www.autohotkey.com/docs/misc/Clipboard.htm" 
valueofthis:="value=""" ; double quotes means 1 quote, ending quote *is* required 
clipboard_me_some_htmls(file_containing_example_html_you_posted,valueofthis,1) 
return 
clipboard_me_some_htmls(url,stringtofind,whichone) 
{ 
    file:="here.html" ; website cached here to be read from, can be changed to file path, defaults to script directory 
    ;UrlDownloadToFile, %url% , %file% 
    fileread, htmls , %file% 
    aquote:="""" ; two quotes means one quote 
    StringGetPos, valuelocation, htmls, %stringtofind% 
    StringGetPos, quotelocation, htmls, %aquote%,L%whichone%,%valuelocation% ; find immediate next quote 
    StringMid, valuesvalue, htmls,% valuelocation+StrLen(stringtofind)+1, % quotelocation-valuelocation-2 ;get string between stringtofind and the next quote 
    Clipboard:=valuesvalue ; press ctrl v afterwards and enjoy your saved time 
} 

呼叫与URL为要扫描的网站功能,保持stringtofind一样,因为它是现在,和whichone第一次出现为1,第二次出现2次。在这个例子中,你给1是把1223放在剪贴板中,2是把CABRILLO PARK放在剪贴板中。

+0

请注意,这绝不是实际解析html的替代品,如果您必须在html中进行任何** real **解析,您可以在单独的程序中执行此操作,并使用autohotkey运行它以利用便捷的剪贴板和url加载功能。 – gunfulker 2014-08-29 08:04:13