lluxury 发表于 2011-6-22 00:14:03

用au3写网页源码

本帖最后由 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

klpwap 发表于 2011-8-11 17:03:21

谢谢分享,学习

续缘8003 发表于 2013-9-18 08:19:06

谢谢提供,学习了。
页: [1]
查看完整版本: 用au3写网页源码