我的需求是这样的:
一、delphi调用百度进行搜索。
二、返回搜索结果(十个也好,二十个也好,全部也好,您只要帮我实现)
不胜感激!
一、delphi调用百度进行搜索。
二、返回搜索结果(十个也好,二十个也好,全部也好,您只要帮我实现)
不胜感激!
解决方案 »
- Delphi之reportBuilder報表選中某行或多行打印問題
- idispatch参数 的问题
- Delphi 中的 $ 是什么意思?
- 用DBcombobox的时候,运行时为什么下拉列表只有一个值啊(在线等)
- 请问在DBgrid中如何不显示SQL数据表中日期时间型字段的日期部分
- 帮我看看!先给100,答玩再给100
- 怎么样保存bookmark?或者如何保存记录的当前位置?在线等!
- 不知道大家遇到过没有……
- cxGrid 动态添加的列,用StoreToIniFile把列信息保存到Ini文件,但是失败,求大侠
- 求助:Socket的多线程问题(72分,一定给)
- 想用delphi做一个版面,是image滑动变换的或者是点击变换的,可以用timer
- 求邮件XX
begin
WebBrowser1.Navigate('www.baidu.com');
end;
var
I: Integer;
Document: IHTMLDocument2;
Element: IHTMLElement;
Anchors: IHTMLElementCollection;
sLink: string;
begin
//查找网易新闻页面链接
sLink := 'http://news.163.com/';
Document := Webbrowser1.Document as IHTMLDocument2;
if Assigned(Document) then
begin
Anchors := Document.Get_links;
//遍历所有链接
for i := 0 to Anchors.length - 1 do
begin
Element := Anchors.item(i, varempty) as IHTMLElement;
//找到指定链接
if Assigned(Element) and (UpperCase((Element as IHTMLAnchorElement).href) = UpperCase(sLink)) then
begin
//执行点击
Element.Click;
Break;
end;
end;
end;
end; 当然这这是执行点击的代码。你还要执行往输入框写文字的。 你自己好好补充啊
if Succeeded(Dispatch.QueryInterface(IHTMLInputElement,HTMLInputElement)) then
begin
With HTMLInputElement do//单行文本
begin
if UpperCase(Type_)='TEXT' then//判断输入框类型;
begin
if trim(basedata.SysInfo.strWebadvKeyWord)<>'' then
begin
if (Name=copy(trim(basedata.SysInfo.strWebadvKeyWord),1,pos(',',trim(basedata.SysInfo.strWebadvKeyWord))-1))
or(Name=copy(trim(basedata.SysInfo.strWebadvKeyWord),pos(',',trim(basedata.SysInfo.strWebadvKeyWord))+1)) then
begin
Value:=strkeyword;
exit;
end;
end;
end;
end;
end
会JS吧,先去看HTML 页面每一个元素都可获取,可以操作。很简单