OZの部屋

なんでも日記です

Delphi TWebBrowser

2006-11-08 22:48:45 | プログラム
Delphi v7
TwebBrowser を今日はじめて使ってみた。
フォームにボタンとwebbrowserを貼り付けて
ボタンのOnClickで
procedure TForm1.Button1Click(Sender: TObject);
begin
  webbrowser1.Navigate('http://www.goo.ne.jp/');
end;


これでボタンを押すと簡単にIEと同じみたい。  と思ったら、システムのブラウザで表示しているということだからIEそのものじゃないか。

でもこれをプログラムで使うには一山ふた山大変そう。
まず。表示したHTMLソースをMemoに表示してみたい。

プロパティのDocument ありゃ これは 
property Document: IDispatch;

んーー これの使い方さっぱり と思ったら

http://www.cryer.co.uk/brian/delphi/twebbrowser/twebbrowser_oleobject.htm

こんなの見つけました。
やはりこの方も参っている?

MSのサイトを見てもさっぱりどうしたらいいのやら。

とりあえず。
Memoとボタンをもうひとつ付けて
procedure TForm1.Button2Click(Sender: TObject);
begin
  memo1.Lines.Text:=WebBrowser1.OleObject.Document.documentElement.innerHTML;
end;


なんとかソースはとれた。UTF8のはずなんだけどMemoでは化けずにちゃんと日本語が表示されている。
ちなみに、GooブログはEUCなんだけれども、これもEUC変換しないでMemoに表示されている。
ある意味楽チン。。。

URLにローカルファイルを指定すればもちろん表示される。

しかし、
WebBrowser1.OleObject.Document.documentElement.innerHTML:=string;

なんてしたいけど、ダメでした。

もうちょっと探ってみよう。


最新の画像もっと見る

2 コメント

コメント日が  古い順  |   新しい順
hervelegerdress@outlook.com (herve leger)
2020-02-24 23:28:13
https://legerdresses.hateblo.jp/entry/2020/01/28/224736
https://is.gd/BebEb2
https://is.gd/iC9tnd
https://is.gd/zu0Osm
http://bit.ly/2RUM6jI
http://bit.ly/2U5A3Tu
https://legerdresses.hateblo.jp/entry/2020/01/28/225622
https://legerdresses.hateblo.jp/entry/2020/01/28/230359
http://bit.ly/3129DDs
http://bit.ly/2tQQFnn
https://tinyurl.com/vsfxlhu
https://tinyurl.com/rclrs2p
https://tinyurl.com/yx6foctn
https://5e2e91edd225a.site123.me/blog/Herve-leger-story
https://is.gd/5kDxkC
https://is.gd/ntmnfL
https://5e2e91edd225a.site123.me/blog/herve-leger-history
https://5e2e91edd225a.site123.me/blog/herve-leger-things
https://tinyurl.com/vkpjf4s
https://tinyurl.com/vc4t2t3
http://tiny.cc/73wbjz
http://tiny.cc/05wbjz
http://tiny.cc/57wbjz
http://bit.do/fvjG3
http://tiny.cc/d8wbjz
https://ameblo.jp/legerdresses/entry-12570454577.html
https://is.gd/5bVDky
https://is.gd/fAKquP
https://is.gd/jKKd58
http://bit.ly/2t7C3zv
http://bit.ly/38LL4NN
http://bit.ly/2tbhfXS
https://tinyurl.com/teadob9
https://tinyurl.com/u2s9wkl
http://tiny.cc/y8wbjz
http://tiny.cc/o9wbjz
http://tiny.cc/p9wbjz
返信する
Replica Orologi (Replica Orologi)
2021-11-29 15:51:25
https://musescore.com/user/40847359
https://is.gd/TIEWwI
https://is.gd/aJJL0V
https://is.gd/hMCh1J
https://is.gd/v5Iyuc
https://is.gd/UivF3D
https://is.gd/90JtRR
https://www.instapaper.com/p/orologireplica
https://bit.ly/3DlwOLi
https://bit.ly/3HDmm4D
https://bit.ly/3nke6hC
https://bit.ly/2YUMeay
https://bit.ly/3osZ5cG
https://bit.ly/30spNtA
https://sites.google.com/view/orologimeccanici/
https://tinyurl.com/wzexvkrr
https://tinyurl.com/84cr46r8
https://tinyurl.com/3ny8e2kd
https://tinyurl.com/6yjjkub5
https://tinyurl.com/nzcvu4sx
https://tinyurl.com/9n27y87w
https://demo.wowonder.com/1636347366404188_144954
http://tiny.cc/5zpluz
http://tiny.cc/6zpluz
http://tiny.cc/8zpluz
http://tiny.cc/bzpluz
http://tiny.cc/czpluz
http://tiny.cc/dzpluz
https://docs.google.com/file/d/1qhJu7L7WEO78QX8-NZtFJqwhr5YJSTtkOpJW9cIYUHk/view
https://www.intensedebate.com/people/orologiwatch
https://rebrand.ly/05f7o9u
https://rebrand.ly/b0fk5vx
https://rebrand.ly/niskt9g
https://rebrand.ly/5ybsg7e
https://rebrand.ly/7k6gcy9
https://rebrand.ly/own4dfl
返信する