【发布时间】:2012-04-01 03:37:31
【问题描述】:
我正在尝试从 Google 搜索结果中提取 URL。我使用 Indy IdHTTP 从 Google 获取 HTML 结果,我使用Achmad Z's code for getting the link hrefs from the page。如何获取每个 URL 的真实链接目标,而不是通过 Google 重定向器的链接目标?
我试过了,但在这部分代码中出现“操作数不适用”错误:
function ToUTF8Encode(str: string): string;
var
b: Byte;
begin
for b in BytesOf(UTF8Encode(str)) do
begin
Result := Format('%s%s%.2x', [Result, '%', b]);
end;
end;
我使用 Delphi 7 和 Indy 9.00.10。也许 indy 更新会有所帮助?
【问题讨论】:
-
好的,告诉我们你尝试了什么以及这些尝试是如何失败的。
-
Google 会进行严重的浏览器嗅探和点击计数,将您自制的用户代理屏蔽为 Opera 可能会有所帮助。