问题是这样的, 下面有个htm文件的源码, 先点提交按钮,然后点“获取IFrame内 容或者链接地址”按钮时,能够取到IFRAME里面的内容或者内容的链接地址(即: http://www.baidu.com/s?wd=mp3)就行。解决的话,马上充200元手机费。骗子 死。   本人QQ:32690738 
HTM文件源码 
<form action="http://www.baidu.com/s" target="ret"> 
<input name="wd" value="mp3"><br> 
<input type="submit" value="提交"> 
<input type="button" value="获取IFRAME的内容或者链接地址"> 
<form> 
<div> 
<iframe id="ret" name="ret" height= "100%"   width= "100%"  frameborder= "1"   scrolling= "auto"></iframe> 
</div>

解决方案 »

  1.   

    <form action="http://www.baidu.com/s" target="ret">  
    <input name="wd" value="mp3"><br>  
    <input type="submit" value="提交">  
    <input type="button" value="获取IFRAME的内容或者链接地址">  
    <form>  
    <div> =>
    <form action="http://www.baidu.com/s" target="ret">  
    <input name="wd" value="mp3"><br>  
    <input type="submit" value="提交">  
    <input type="button" value="获取IFRAME的内容或者链接地址" onclick="getvalues()">  
    <form>  
    <div> <script type='text/javascript'>
        function getvalues() {
            var form = document.forms[0]
            var val = form.action + "?wd=" + form.name.value;
        }
    </script>
      

  2.   

    你这个方法不对。FROM提交出去之后,要通过js方法动态的获取IFRAME里的内容。而不是拿FORM的action和name拼一个串出来
      

  3.   

    给你个简单的做法  用jQuery来做吧~~~!
    刚才给你解答的时候没在意题目~~~!我笑的是你的题目如果为了小利来CSDN。我何必呢
      

  4.   

    cj205  纵使你有技术你也不要笑人,楼主不是用蝇头小利来吸引人,有时候着急于某个功能的实现,那是楼主对热心人士表示感激的心意。
    请不要笑话人家。
    我认为这是很好的表现。
    有时候我急于某个功能的实现 也会以200羊悬赏,求热心人帮助,可是csdn的版主竟然痛下杀手~!!!
      

  5.   

    那请你自省下吧~~~!
    如果是跨域的话,我觉得还是用autoIT等自动化工具吧~~我之前做自动注册的时候也是用这个工具写的脚本
    因为ajax也好,框架也好,安全问题是解决不了
      

  6.   

    来CSDN提问的人形形色色,我08年注册至今,多次放弃回答问题就是因为有些人实在让人无语。
    我不要求谁谁谁的态度多好,你只要能叙述好需求,我在能力和时间允许的情况下帮助解决,但是如果需求描述的不清,还态度很……。
    算了 这些问题说了不知道多少遍了。楼主的做法本身没有问题,比如我公司的网站曾经请人推广网站的时候也请过别人帮过忙,但是我希望在合适的地方做合适的事。如果我希望能够赚点外快,我可以去找私活,我何必耗这么多时间来CSDN免费答题呢。大家遇到的问题,能够帮助解决一方面是增加经验,另一方面能够帮助自己不生疏某些知识。
      

  7.   

    这个有什么难的吗。
    用小偷程序或转静态技术中的XTMLHTTP,来读取目标页,存入一个字串变量,再在字串变量里查找要找的内容就是了。
      

  8.   


    观望中!~  解决问题 不带吵架滴  心平气和才好  楼主的问题!  不懂!  嘿嘿!~  现在极力的补充各种js知识!  尤其是jquery
      

  9.   

    换个思路不可以吗?1、根据你要得到的页面,动态设置iframe的src。
    2、用C#在后台得到你要的内容    
    private static string GetPage(string url)
        {
            HttpWebRequest webRequest = (HttpWebRequest)WebRequest.Create(url);
            HttpWebResponse webResponse = (HttpWebResponse)webRequest.GetResponse();
            Stream stream = webResponse.GetResponseStream();
            StreamReader reader = new StreamReader(stream, System.Text.Encoding.GetEncoding("GB2312"));
            //整个页面内容
            string content = reader.ReadToEnd();
            return content;
        }
      

  10.   


    using System;
    using System.Data;
    using System.Configuration;
    using System.Collections;
    using System.Web;
    using System.Web.Security;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using System.Web.UI.WebControls.WebParts;
    using System.Web.UI.HtmlControls;
    using System.Text;
    using System.IO;
    using System.Net;
    using System.Collections.Generic;public partial class Demo : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {    }
        private static string GetPage(string url)
        {
            HttpWebRequest webRequest = (HttpWebRequest)WebRequest.Create(url);
            HttpWebResponse webResponse = (HttpWebResponse)webRequest.GetResponse();
            Stream stream = webResponse.GetResponseStream();
            StreamReader reader = new StreamReader(stream, System.Text.Encoding.GetEncoding("GB2312"));
            //整个页面内容
            string content = reader.ReadToEnd();
            return content;
        }
        protected void GetContect_Click(object sender, EventArgs e)
        {
            txt_Contect.InnerHtml=GetPage("http://www.baidu.com/s?wd=mp3");
        }
    }
    单击事件可以得到页面的源代码
      

  11.   

    http://topic.csdn.net/u/20100614/22/8dad5106-71e9-416f-b6f7-7dfeb9417153.html
      

  12.   

    <?php 
    if(isset($_GET['url'])){
    if(isset($_GET['wd'])){
    $url =  $_GET['url'].'?wd='.$_GET['wd'];
    $fp = @fopen($url, "r") or die("超时");
    $fcontents = file_get_contents($url);//所截获的内容
    }
    }
    ?>
    <form action="weatherreport1.php" target="ret">  
    <input type="text" name="url" value = "http://www.baidu.com/s" />
    <input name="wd" value="mp3"><br>  
    <input type="submit" value="提交">  
    <input type="button" value="获取IFRAME的内容或者链接地址">  
    </form>  
    <div>  
    <iframe id="ret" name="ret" height= "100%" width= "100%" frameborder= "1" scrolling= "auto"></iframe> 
    </div>php倒是容易获得内容
      

  13.   

    <html>
        <head>
            <script>
                function getUrl(){
                    alert(document.getElementById("ret").getAttribute("src"));
                }
            </script>
        </head>
        <body>
            <form action="http://www.baidu.com/s" target="ret"> 
            <input name="wd" value="mp3"><br> 
            <input type="submit" value="提交"> 
            <input type="button" value="获取IFRAME的内容或者链接地址" onclick="getUrl()">  
            
            <form> 
            <div> 
            <iframe id="ret" name="ret" height= "100%" width= "100%" frameborder= "1" scrolling= "auto" src="aa.html"></iframe> 
            </div>
        </body>
    <html>
      

  14.   

    http://q.sohu.com/forum/5/topic/3466563
      

  15.   

    <input name="wd" id="wd" value="mp3"><br>  
    <input type="button" value="提交" onclick="postvalue()">  
    <input type="button" value="获取IFRAME的内容或者链接地址" onclick="geturl()">  
     
    <div>  
    <iframe id="ret" name="ret" height= "100%" width= "100%" frameborder= "1" scrolling= "auto"></iframe>  
    </div><script>
    function postvalue()
    {
       document.getElementById("ret").src = "http://www.baidu.com/s?wd=" + document.getElementById("wd").value;
    }
    function geturl()
    {
       alert(document.getElementById("ret").src);
    }
    </script>已经测试成功,请结贴