0

我正在处理自动填写表格,但我没有通过图片上传。图片上传在没有 id 或名称的 iframe 内。我想知道我是否可以为之类添加一个值

webbrowser1.document.getelementbyid("file[]").setAttribute("Value","Url")

或者

WebBrowser1.Document.Window.Frames("file[]")...

下面是 html 代码(我没有更改它的权限)

 <iframe width="250" scrolling="no" height="22" frameborder="no" marginwidth="0" marginheight="0" allowtransparency="true" border="0" src="/upload.html?v4#mdrp9c7tlgin8d038qnj6mnmi4">#document<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html lang="en" xml:lang="en" xmlns="http://www.w3.org/1999/xhtml"><head></head>
    <body>
    <div id="button_container"><object id="SWFUpload_0" class="swfupload" width="250" height="22" data="/swfupload250beta3/swfupload.swf?wrapperbrowsercheck=0.7308926264884217&preventswfcaching=1354384013251" type="application/x-shockwave-flash"></object></div>
    <form enctype="multipart/form-data" target="uploader" action="/upload.php" method="post"><input id="file" type="file" onchange="fileUploadStart(this);" name="file[]"></input></form>
    </body></html></iframe>
4

1 回答 1

0

使用 jQuery:

$("iframe").contents().find("#file").attr("Value","Url")
于 2012-12-01T19:56:20.583 回答