<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    kooyee ‘s blog

    開源軟件, 眾人努力的結晶, 全人類的共同財富
    posts - 103, comments - 55, trackbacks - 0, articles - 66
       :: 首頁 :: 新隨筆 :: 聯系 :: 聚合  :: 管理

    VB使用WebBrowser讀取網頁內容

    Posted on 2008-07-11 09:55 kooyee 閱讀(12253) 評論(6)  編輯  收藏
    '得到當前browser的頁面字體內容
    Public Function getWebContent(browser As WebBrowser) As String
        
    Dim doc As Object
        
    Dim i As Object
        
    Dim strHtml As String
        
        
    Set doc = browser.Document
        
    For Each i In doc.All
            strHtml 
    = strHtml & Chr(13& i.innerText
        
    Next
        getWebContent 
    = strHtml
    End Function
    上面這個函數可以得到browser中所有文字信息.

    '得到當前browser的頁面Html內容
    Public Function getWebHtml(browser As WebBrowser) As String
        
    Dim doc As Object
        
    Dim i As Object
        
    Dim strHtml As String
        
        
    Set doc = browser.Document
        
    For Each i In doc.All
            strHtml 
    = strHtml & Chr(13& i.innerHtml
        
    Next
        getWebHtml 
    = strHtml
    End Function
     上面這個函數可以得到browser頁面的HTML代碼.

    評論

    # re: VB使用WebBrowser讀取網頁內容  回復  更多評論   

    2008-10-16 21:18 by work_man
    請問,如何調用呢?

    # re: VB使用WebBrowser讀取網頁內容  回復  更多評論   

    2008-10-18 21:24 by kooyee
    看看這段代碼

    Dim vDoc, vTag

    Dim i As Integer

    Set vDoc = WebBrowser1.Document

    For i = 0 To vDoc.All.Length - 1 '檢測所有標簽

    If UCase(vDoc.All(i).innerText) = "INPUT" Then '找到input標簽

    Set vTag = vDoc.All(i)

    # re: VB使用WebBrowser讀取網頁內容  回復  更多評論   

    2008-11-24 20:13 by 肖子詳
    Private Sub Command1_Click()
    WebBrowser1.Navigate "http://www.baidu.com"
    End Sub

    Private Sub Command2_Click()
    Dim vDoc, vTag

    Dim i As Integer

    Set vDoc = WebBrowser1.Document

    For i = 0 To vDoc.All.Length - 1 '檢測所有標簽

    If UCase(vDoc.All(i).innerText) = "INPUT" Then '找到input標簽

    Set vTag = vDoc.All(i)
    End If
    Next
    Text1.Text = vTag

    End Sub


    還是不可以?上面是我做的我想把讀到的內容存到TEXT1.TEXT中?

    # re: VB使用WebBrowser讀取網頁內容  回復  更多評論   

    2008-11-24 20:34 by 肖子詳
    我試過了可以讀到網頁里的文字信息,TKS

    但讀的HTML代碼.會亂碼.

    # re: VB使用WebBrowser讀取網頁內容[未登錄]  回復  更多評論   

    2008-11-26 01:14 by kooyee
    是不是不支持unicode?

    # re: VB使用WebBrowser讀取網頁內容  回復  更多評論   

    2010-01-23 11:25 by webyoung
    Click a arrow on a google web site automaticly.

    --------------------------------------------------------------------------------

    I want to write a code to click automaticly the "next arrow" or the "last arrow" on the bottom of the following web site.

    http://www.google.com/finance/stocks...rt=&sortOrder=

    I know the htmlText for these two arrow is as following:


    HTML Code:
    <DIV class=tpbd closure_hashCode_f042o7="42">
    <DIV class=SP_arrow_next></DIV></DIV>
    <DIV class=tpsd>21 - 40 of 2658 rows</DIV>
    <DIV class=tpbd closure_hashCode_f042o7="41">
    <DIV class=SP_arrow_previous></DIV></DIV>
    <DIV class=tpbd closure_hashCode_f042o7="40">
    <DIV class=SP_arrow_first></DIV></DIV><SELECT class=tpdd
    closure_hashCode_f042o7="39"><OPTION value=10>10</OPTION><OPTION selected
    value=20>20</OPTION><OPTION value=30>30</OPTION></SELECT>
    <DIV class=tpsrd>Show rows:</DIV>
    But I can not find a way write it. If anybody can show me how to do it, will be deep appreciated.

    只有注冊用戶登錄后才能發表評論。


    網站導航:
     
    主站蜘蛛池模板: 美女免费精品高清毛片在线视| 亚洲色大成网站www永久男同 | 免费一级毛片在线播放视频免费观看永久| 特级毛片A级毛片免费播放| 午夜影视在线免费观看| 免费永久国产在线视频| 亚洲av色福利天堂| 美女羞羞视频免费网站| 国产国产人免费视频成69大陆| 亚洲欧洲日韩不卡| 午夜在线免费视频 | 福利免费在线观看| 毛片免费观看视频| 亚洲国产精品不卡在线电影| 久久久久久AV无码免费网站| 亚洲中文字幕伊人久久无码| 亚洲不卡1卡2卡三卡2021麻豆| 国产精品无码永久免费888| 最好免费观看韩国+日本| 亚洲日本va午夜中文字幕久久| 深夜免费在线视频| 亚洲va无码va在线va天堂| 精品在线观看免费| 国产免费女女脚奴视频网| 亚洲αv久久久噜噜噜噜噜| 99精品视频在线观看免费播放 | 国产日产亚洲系列最新| 亚洲日韩久久综合中文字幕| 91久久成人免费| 国产亚洲自拍一区| 99re免费99re在线视频手机版| 亚洲AV无码无限在线观看不卡| 最近免费中文字幕大全高清大全1| 亚洲色成人中文字幕网站| 一级毛片高清免费播放| 高清在线亚洲精品国产二区| 久久亚洲精品成人无码| 国产成人免费a在线资源| 中文字幕看片在线a免费| 亚洲中文久久精品无码1| 午夜亚洲国产成人不卡在线 |