找回密码
 加入
搜索
查看: 1954|回复: 2

[IE类操作] 如何读取一个网页的一个特定的字符呢?

  [复制链接]
发表于 2012-12-20 18:07:39 | 显示全部楼层 |阅读模式
我对读取网页的过程很难理解,也不知道应该用哪个UDF,我对正则也不是很明白
网址是这个
http://paper.pubmed.cn/ebeco448a9
我想得到23181270这个数字,我应该怎么做呢?
发表于 2012-12-21 09:49:11 | 显示全部楼层
#include <INet.au3>
$s_URL = "http://paper.pubmed.cn/ebeco448a9"
$html = _INetGetSource($s_URL)
$getnumber = StringRegExp($html, 'href="http://pubmed.cn/(.*?)" target="_blank', 3)
If @error = 0 Then
        MsgBox(0, "", $getnumber[0])
EndIf
发表于 2012-12-21 12:14:26 | 显示全部楼层
正则在保证精准的前提下可以再简化下:
#include <INet.au3>
$s_URL = "http://paper.pubmed.cn/ebeco448a9"
$html = _INetGetSource($s_URL)
$getnumber = StringRegExp($html, '/(\d+)<', 3)
If @error = 0 Then
        MsgBox(0, "", $getnumber[0])
EndIf
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-5-15 20:13 , Processed in 0.073352 second(s), 23 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表