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

[原创] 用au3写网页源码

[复制链接]
发表于 2011-6-22 00:14:03 | 显示全部楼层 |阅读模式
本帖最后由 lluxury 于 2011-6-22 00:16 编辑

别抄下来就用,看看黑体就好了,搜关键词,生成对应页面的连接



#Region ;**** 参数创建于 ACNWrapper_GUI ****
#AutoIt3Wrapper_icon=C:\Windows\syswow64\SHELL32.dll|-41
#AutoIt3Wrapper_outfile=C:\Users\Administrator\Desktop\DJ列表.exe
#AutoIt3Wrapper_UseX64=n
#EndRegion ;**** 参数创建于 ACNWrapper_GUI ****
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <Array.au3>
#include <INet.au3>
Opt("GUIOnEventMode", 1)
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("DJ列表", 366, 84, 192, 124)
GUISetOnEvent($GUI_EVENT_CLOSE, "Form1Close")

$Input1 = GUICtrlCreateInput("例http://www.baidu.com/baran", 8, 40, 337, 21)
GUICtrlSetOnEvent(-1, "Input1Change")
$Label1 = GUICtrlCreateLabel("请输入喜爱DJ的列表网址", 16, 8, 137, 17)

$Button1 = GUICtrlCreateButton("生成听歌", 224, 8, 75, 25)
GUICtrlSetOnEvent(-1, "Button1Click")
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
Global $oIE
While 1
        Sleep(100)
WEnd

Func Button1Click()
FileDelete(@DesktopDir & "\DJ列表.html")
;~ $oIE = "http://www.baidu.com/tears"
$s_URL = $oIE
$soure = _INetGetSource($s_URL)
$array = StringRegExp($soure, '/note/([^>]+)', 3)
;~ _ArrayDisplay($array,'Debug~~~')
$file = FileOpen("DJ列表.html", 1)
FileWrite ( @DesktopDir & "\DJ列表.html" , '<a href='&$oIE&'>'&$oIE&'<a><br />' )
For $n = 0 To UBound($Array)
FileWrite ( @DesktopDir & "\DJ列表.html" , '<a href="http://www.baidu.com/music/'&$array[$n]&'>the '&$n&'song<a><br />' )
Next

FileClose($file)
EndFunc

Func Form1Close()
Exit
EndFunc

Func Input1Change()
$oIE=GUICtrlRead($Input1)
EndFunc
发表于 2011-8-11 17:03:21 | 显示全部楼层
谢谢分享,学习
发表于 2013-9-18 08:19:06 | 显示全部楼层
谢谢提供,学习了。
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-5-4 17:24 , Processed in 0.071682 second(s), 19 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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