使用 coldfusion 添加 http 请求 header 到 href link
Adding http request header to href link with coldfusion
我正在抓取外部网站并使用 cfx_http5 标签获取数据,因为 cfhttp
非常慢,所以使用 cfx_http5
,它不会解析 url ,使用 cfhttp 它执行 resolveurl 所以使 url 指向文件来自的相同域
现在我需要使用 cfx 标签,但我所有的 url 都将作为:
和cfx_http5
<a href="details.cfm?acb=1>cick</a>
使用 cfhttp:
<a href="http://theddomain.com/details.cfm?acb=1>cick</a>
那么我如何在 coldfusion 中添加代码以将此 url 附加到所有 href 标签
请指导
试试这个:
<cfset httpResult = ReplaceNoCase(httpResult, '<a href="', '<a href="http://theddomain.com/', 'all')>
我正在抓取外部网站并使用 cfx_http5 标签获取数据,因为 cfhttp
非常慢,所以使用 cfx_http5
,它不会解析 url ,使用 cfhttp 它执行 resolveurl 所以使 url 指向文件来自的相同域
现在我需要使用 cfx 标签,但我所有的 url 都将作为:
和cfx_http5
<a href="details.cfm?acb=1>cick</a>
使用 cfhttp:
<a href="http://theddomain.com/details.cfm?acb=1>cick</a>
那么我如何在 coldfusion 中添加代码以将此 url 附加到所有 href 标签
请指导
试试这个:
<cfset httpResult = ReplaceNoCase(httpResult, '<a href="', '<a href="http://theddomain.com/', 'all')>