当前位置:首页 > 代码 > 正文

网站链接代码(接代码的网站)

admin 发布:2022-12-19 19:15 105


本篇文章给大家谈谈网站链接代码,以及接代码的网站对应的知识点,希望对各位有所帮助,不要忘了收藏本站喔。

本文目录一览:

如何提取网页源代码中的链接代码?

Private Sub Command1_Click()

Dim s As String

s = Text1.Text

s = Replace(Text1.Text, vbCrLf, "") '移除所有回车换行符

'Dim oRegEx As RegExp

'Set oRegEx = New RegExp

'Dim oMatches As MatchCollection

'Dim oMatch As Match

Dim oRegEx As Object

Set oRegEx = CreateObject("VBScript.RegExp")

Dim oMatches As Object

Dim oMatch As Object

With oRegEx

.Global = True '全局匹配

.IgnoreCase = True '忽略大小写

.Pattern = "a[^]*?href=[""' ]?(.*?)(?:""|'| ).[^ ]*?([\s\S]*?)/a"

'提取所有A标签的正则式,小括号中是子匹配引用组第一个是 (.*?) 第二个是([\s\S]*?)

Set oMatches = .Execute(s)

If oMatches.Count = 1 Then

Text2.Text = ""

Dim sHref As String, sInnerText As String

Dim i As Integer

Dim sLink As String

'Dim colLinks As Scripting.Dictionary

'Set colLinks = New Scripting.Dictionary

Dim colLinks As Object

Set colLinks = CreateObject("Scripting.Dictionary")

For Each oMatch In oMatches

sHref = oMatch.SubMatches(0) '(.*?)

sInnerText = oMatch.SubMatches(1) '([\s\S]*?)

sInnerText = RemoveTags(sInnerText) '移除A标签(内容)中的多余标签

sInnerText = Replace(sInnerText, " ", "") '移除A标签(内容)中的所有空格

sLink = "A href=""" sHref """" sInnerText "/A"

If Not colLinks.Exists(sLink) Then

colLinks.Add sLink, sLink

Text2.Text = Text2.Text sLink vbNewLine

End If

Next

End If

End With

Set oMatches = Nothing

Set oMatch = Nothing

Set oRegEx = Nothing

Set colLinks = Nothing

End Sub

'这个函数可以去除HTML代码中的标签

Function RemoveTags(ByVal html As String)

'Dim oRegEx As RegExp

'Set oRegEx = New RegExp

Dim oRegEx As Object

Set oRegEx = CreateObject("VBScript.RegExp")

With oRegEx

.Global = True

.IgnoreCase = True

.Pattern = "[^]*"

RemoveTags = .Replace(html, "")

End With

Set oRegEx = Nothing

End Function

网站友情链接代码如何添加对方地址

1、首先,输入我们网站的后台地址,用账号与密码登录进去。

2、一般友情链接管理的地方都是在后台一个叫做“标签管理”的地方,如下图所示。

3、点击进去,在众多的标签中找到“友情链接”或者是代码为“{My:friendlink}”的地方进行修改。

4、点击设置其“源代码”然后复制上面的友链代码信息另起一行,将下图中的网址与关键词改成我们需要添加的网站后,点击保存。

5、完成之后我们只需要重新生成一次首页即可,点击“静态发布”——“生成首页”,重新生成后点击浏览即可直接进入到我们网站的首页中。

6、将页面拖到最下面寻找网站的友情链接,我们会发现在原有的基础上增加了一条友链,并且可以点击到该网站的首页去,就代表这条友情链接已经被我们添加成功了。

如何制作自己的网页链接

如何制作自己的网页链接

html语言做网页链接.最快、最简单的做网页链接就是用html语言。

在桌面上新建一个txt文档。

打开txt文档,里面插入如下网页链接代码即可。

上面代码中。

都是一对对出现的,这是最简单的html语言,反斜杠:/,代表结束语句标签。

head表示网页的头部,title表示具体的标题是什么,body表示网页内容,href表示链接网址标记。

保存txt文档代码内容,取名叫百度.txt,再另存为:百度.html。

然后打开方式选择IE打开。

网站链接代码的介绍就聊到这里吧,感谢你花时间阅读本站内容,更多关于接代码的网站、网站链接代码的信息别忘了在本站进行查找喔。

版权说明:如非注明,本站文章均为 AH站长 原创,转载请注明出处和附带本文链接;

本文地址:http://ahzz.com.cn/post/19803.html


取消回复欢迎 发表评论:

分享到

温馨提示

下载成功了么?或者链接失效了?

联系我们反馈

立即下载