您可以使用javascript查找URL';然后将这些信息传递到coldfusion?

您可以使用javascript查找URL';然后将这些信息传递到coldfusion?,javascript,regex,image,url,coldfusion,Javascript,Regex,Image,Url,Coldfusion,您可以使用javascript查找图像的URL,然后将该信息传递到coldfusion中,而不在CF或JS中使用regx吗 在我看来,firefly可以很好地找到GetImageURL的InsideNet选项卡,DOM可以理解什么是图像对象或图像链接 我是否可以访问已在其他地方排序的信息堆栈 创建图像的代码看起来像e=newl(f | |“//chart.googleapis.com/chart”);及 可在以下网址找到 我们的目标是使用这些图表在 我以前的备用方法是cfhttp和两个regex

您可以使用javascript查找图像的URL,然后将该信息传递到coldfusion中,而不在CF或JS中使用regx吗

在我看来,firefly可以很好地找到GetImageURL的InsideNet选项卡,DOM可以理解什么是图像对象或图像链接

我是否可以访问已在其他地方排序的信息堆栈

创建图像的代码看起来像e=newl(f | |“//chart.googleapis.com/chart”);及 可在以下网址找到

我们的目标是使用这些图表在

我以前的备用方法是cfhttp和两个regex

script=REMatchNoCase(']>[^.+?',objGet.FileContent)//>//获取divs

我正在研究javascript反射或iframe内部的反射


谢谢,我已经测试过了,它确实有效。希望我对“工作”的理解和你的一样。这里有一些技巧,因为你需要访问的图像是通过浏览器中的javascript渲染生成的,所以服务器端屏幕抓取是不够的(除非事情变得非常复杂,我不会去那里)。此外,事情很棘手,因为您需要加载的内容位于远程域(www.google.com),这意味着您在浏览器中访问这些内容的方式受到限制(如果没有适当的访问控制,就无法通过Ajax实现这一点。google服务器上的Allow Origin Header;无法通过嵌入类似限制的直接iframe进行访问,以防止跨域DOM操作).所以,我必须克服这两个限制。注意-我知道你没有要求使用jQuery,但它确实让这里的生活变得更加轻松,所以我继续使用它。下面是我如何让它工作的:

index.cfm

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script>
$(function () {
        $("#googleFrame").load(function () { // bind to the load event, so we'll know that the embedded resources will all have finished rendering (including the images we're after)

                // this will simply include the images from google on the current page
                $("#rippedGoogleImages")
                   .html('') // remove the loading message
                   .append($(this).contents().find("img.goog-serverchart-image")); // pull the loaded images out of the frame

                // if you just want to see the URLs of those images:
                /* $(this).contents().find("img.goog-serverchart-image").each(function (){
                    console.log($(this).attr('src'));
                });
                */

        });
        $("#googleFrame").attr("src", "googleProxy.cfm"); // trickiness that will become clear below
});
</script>

<iframe id="googleFrame" style="display:none"></iframe><!-- hidden iframe -->

<h1>Finance Images</h1>

<div id="rippedGoogleImages">
Loading Images From Google...
</div>

$(函数(){
$(“#googleFrame”).load(函数(){//绑定到load事件,这样我们就知道嵌入的资源将全部完成渲染(包括我们要处理的图像)
//这将只包括当前页面上来自谷歌的图像
$(“rippedGoogleImages”)
.html(“”)//删除正在加载的消息
.append($(this.contents().find(“img.goog serverchart image”);//将加载的图像从帧中拉出
//如果您只想查看这些图像的URL:
/*$(this).contents().find(“img.goog服务器图表图像”).each(函数(){
log($(this.attr('src'));
});
*/
});
$(“#googleFrame”).attr(“src”、“googleProxy.cfm”);//下面将清楚地说明一些技巧
});
金融形象
正在从谷歌加载图像。。。
还有一个让我们绕过跨域限制的关键,这个文件在服务器上执行对google的直接请求:googleProxy.cfm:

<cfhttp url="http://www.google.com/finance?q=NASDAQ:SQNM&fstype=ii">

<cfoutput>
#cfhttp.filecontent#
</cfoutput>
<!--- The next line injects the necessary base href to allow the resources (js, css, images, etc...) to resolve correctly when served from this new location --->
<cfhtmlhead text="<base href='http://www.google.com/finance/'>">

#cfhttp.filecontent#

所有这些都是在没有恶意的服务器端屏幕抓取或正则表达式的情况下完成的。

我不太清楚你到底想做什么。你想在你的页面上有一些JS代码来获取谷歌财经页面并从中提取图像,这样你就可以将这些图像包含在你自己的页面上吗?你好???你在关注这个问题吗uestion?我希望很明显,如果您需要服务器端(CF)上的URL值,您可以使用Ajax(以及其他方法)轻松地将它们发布回服务器端。如果您需要这些值,并且不确定如何执行,请告诉我。