Foxtable(狐表)用户栏目专家坐堂 → [求助]如何提取网页标题


  共有1925人关注过本帖树形打印复制链接

主题:[求助]如何提取网页标题

帅哥哟,离线,有人找我吗?
188802386
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:三尾狐 帖子:629 积分:4927 威望:0 精华:0 注册:2014/2/25 15:50:00
[求助]如何提取网页标题  发帖心情 Post By: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" />


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



 回到顶部
帅哥哟,离线,有人找我吗?
188802386
  2楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:三尾狐 帖子:629 积分:4927 威望:0 精华:0 注册:2014/2/25 15:50:00
  发帖心情 Post By: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()

 回到顶部