以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.net/bbs/index.asp)
--  专家坐堂  (http://foxtable.net/bbs/list.asp?boardid=2)
----  [求助]如何提取网页标题  (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=92620)

--  作者:188802386
--  发布时间:2016/11/8 17:04:00
--  [求助]如何提取网页标题
<!doctype html>
<html>
<head><title>-首页</title>
<meta name="keywords" content="-首页"/>
<meta name="description" content="-首页" />
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" />


请问如何通过网址提取到红色文字内容



--  作者:有点蓝
--  发布时间:2016/11/8 17:34:00
--  
https://www.baidu.com/baidu?word=%E8%8E%B7%E5%8F%96html+title&ie=utf-8&tn=myie2dg&ch=6

http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=32808

http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=49278

--  作者:188802386
--  发布时间:2016/11/8 17:46:00
--  
\' Updates the title bar with the current document title.
Private Sub webBrowser1_DocumentTitleChanged( _
    ByVal sender As Object, ByVal e As EventArgs) _
    Handles webBrowser1.DocumentTitleChanged

    Me.Text = webBrowser1.DocumentTitle

End Sub

但不会呀,麻烦编译一下
Dim page As Integer
Dim web As new windows.forms.webbrowser
web.ScriptErrorsSuppressed = True
For page = 232621561 To 232621562
    Dim txb1 As String = "http://weidian.eallcn.com/" & page
    web.Navigate(txb1)
Do Until web.ReadyState = 4
    Application.DoEvents
Loop
Dim idxx = 1

txb1 = instance.DocumentTitle
output.show(txb1)
For Each dl As object In web.Document.getElementsByTagName("head") 
output.show(DL)
Dim dll =  dl.GetAttribute("title")
    \'If dl.GetAttribute("classname") = "title"  Then
       \' Dim dll = dl.Innertext
        If dll > "" Then
output.show(txb1)
output.show(DL)
        End If
\'End If
    Next
Next
web.Dispose()
GC.Collect()

--  作者:有点蓝
--  发布时间:2016/11/8 18:00:00
--  
Dim page As Integer
Dim web As new windows.forms.webbrowser
web.ScriptErrorsSuppressed = True
For page = 232621561 To 232621562
    Dim txb1 As String = "http://weidian.eallcn.com/" & page
    web.Navigate(txb1)
    Do Until web.ReadyState = 4
        Application.DoEvents
    Loop
    output.show( web.Document.getElementsByTagName("title")(0).InnerText)
Next
web.Dispose()
GC.Collect()

--  作者:ztmdnzc
--  发布时间:2017/6/7 19:49:00
--  
web.Dispose()
GC.Collect()

 

蓝老师:以上两句代码是什么意思?以前没见过。谢谢!

 


--  作者:有点色
--  发布时间:2017/6/7 20:24:00
--  

 web.Dispose()   \'把web对象注销

 GC.Collect() \'把内存资源回收