raedts Posted July 5, 2006 Share Posted July 5, 2006 I want to create a small program with tells you information about a car by typing in it's numberplate.I want to use the page of the dutch RDW, the problem is its ASPX, anyone know how to download the page i need.http://info.apk.nl/ovi/oviinvoer.aspx Link to comment Share on other sites More sharing options...
w0uter Posted July 5, 2006 Share Posted July 5, 2006 (edited) after a bit of messing around this seems to work: expandcollapse popupMsgBox(0, 'Raw HTML', _GetInfo('33-bl-lk')) Func _GetInfo($s_Plate) $s_VIEWSTATE = _INetGetSource("http://info.apk.nl/ovi/oviinvoer.aspx") $s_VIEWSTATE = StringRegExp($s_VIEWSTATE, '<input type="hidden" name="__VIEWSTATE" value="(.*?)" />', 1) Return _INetGetSource("http://info.apk.nl/ovi/oviinvoer.aspx?btnZoeken=Zoeken&txtKenteken=" & StringUpper($s_Plate) & "&__VIEWSTATE=" & $s_VIEWSTATE[0]) EndFunc ;==>_GetInfo Func _INetGetSource($s_URL, $s_Header = '') If StringLeft($s_URL, 7) <> 'http://' And StringLeft($s_URL, 8) <> 'https://' Then $s_URL = 'http://' & $s_URL Local $h_DLL = DllOpen("wininet.dll") Local $ai_IRF, $s_Buf = '' Local $ai_IO = DllCall($h_DLL, 'int', 'InternetOpen', 'str', "AutoIt v3", 'int', 0, 'int', 0, 'int', 0, 'int', 0) If @error Or $ai_IO[0] = 0 Then DllClose($h_DLL) SetError(1) Return "" EndIf Local $ai_IOU = DllCall($h_DLL, 'int', 'InternetOpenUrl', 'int', $ai_IO[0], 'str', $s_URL, 'str', $s_Header, 'int', StringLen($s_Header), 'int', 0x80000000, 'int', 0) If @error Or $ai_IOU[0] = 0 Then DllCall($h_DLL, 'int', 'InternetCloseHandle', 'int', $ai_IO[0]) DllClose($h_DLL) SetError(1) Return "" EndIf Local $v_Struct = DllStructCreate('udword') DllStructSetData($v_Struct, 1, 1) While DllStructGetData($v_Struct, 1) <> 0 $ai_IRF = DllCall($h_DLL, 'int', 'InternetReadFile', 'int', $ai_IOU[0], 'str', '', 'int', 256, 'ptr', DllStructGetPtr($v_Struct)) $s_Buf &= StringLeft($ai_IRF[2], DllStructGetData($v_Struct, 1)) WEnd DllCall($h_DLL, 'int', 'InternetCloseHandle', 'int', $ai_IOU[0]) DllCall($h_DLL, 'int', 'InternetCloseHandle', 'int', $ai_IO[0]) DllClose($h_DLL) Return $s_Buf EndFunc ;==>_INetGetSource Edited July 5, 2006 by w0uter My UDF's:;mem stuff_Mem;ftp stuff_FTP ( OLD );inet stuff_INetGetSource ( OLD )_INetGetImage _INetBrowse ( Collection )_EncodeUrl_NetStat_Google;random stuff_iPixelSearch_DiceRoll Link to comment Share on other sites More sharing options...
DaleHohm Posted July 5, 2006 Share Posted July 5, 2006 I want to create a small program with tells you information about a car by typing in it's numberplate.I want to use the page of the dutch RDW, the problem is its ASPX, anyone know how to download the page i need.http://info.apk.nl/ovi/oviinvoer.aspxThe form functions and table functions in IE.au3 could make short work of that. See _IECreate, _IEFormGetObjByName, _IEFormElementGetObjByName, _IEFormElementSetValue_IEFormSubmit... then on the new page_IETableGetCollection,_IETableWriteToArrayDale Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model Automate input type=file (Related) Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded Better Better? IE.au3 issues with Vista - Workarounds SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead? Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble Link to comment Share on other sites More sharing options...
w0uter Posted July 5, 2006 Share Posted July 5, 2006 Why would he want to use IE ? My UDF's:;mem stuff_Mem;ftp stuff_FTP ( OLD );inet stuff_INetGetSource ( OLD )_INetGetImage _INetBrowse ( Collection )_EncodeUrl_NetStat_Google;random stuff_iPixelSearch_DiceRoll Link to comment Share on other sites More sharing options...
raedts Posted July 5, 2006 Author Share Posted July 5, 2006 hmm looks verry interesting, thank you w0uter... i will let you know when it's done Link to comment Share on other sites More sharing options...
raedts Posted July 5, 2006 Author Share Posted July 5, 2006 After examening your script closer i wrote my own program, i am still testing it but if it works you will find my source code here.the line i was hoping to find was: http://info.apk.nl/ovi/oviinvoer.aspx?btnZ...mp;txtKenteken= Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now