Jump to content

need some tips "for" and "while"


Recommended Posts

Hello,

i try to parse some info from one site, just for fun and experience.

But have some problems, while parsing can't find needed formula,

to make it more easy and performance, can someone help.

Critics allowed, i know code is very bad.. sorry long time no sleep.

Trouble part:

I have removed coz question is to stupid ^^ sry for spam.

Thanks in any case.

Edited by toader

[center][font=courier new,courier,monospace]Die die die my darling[/font][/center][center][font=courier new,courier,monospace]Don't utter a single word[/font][/center][center][font=courier new,courier,monospace]Die die die my darling[/font][/center][center][font=courier new,courier,monospace]Just shut your pretty mouth[/font][/center][center][font=courier new,courier,monospace]I'll be seeing you again[/font][/center][center][font=courier new,courier,monospace]I'll be seeing you[/font][/center][center][font=courier new,courier,monospace]In hell[/font][/center]

Link to comment
Share on other sites

Look at the IE functions because the information iyou've provided s pretty limited and generic, what data are you trying to extract? What is the website? etc...

Edited by guinness

UDF List:

 
_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_ArrayFilter/_ArrayReduce_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 22/04/2018

Link to comment
Share on other sites

Sorry guinness i have removed my post coz think that question is too stupid.. but if you are interested you can take a look:

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <EditConstants.au3>
#include <IE.au3>
#include <array.au3>
#include <String.au3>
$iResult = _IEErrorHandlerRegister()
If $iResult <> 1 then MsgBox(0, "", "_IEErrorHandlerRegister: Error " & @error)
;_IEErrorHandlerRegister()
Global $oIE, $sHTML
Global $iUser = 'viagra', $iPsw = 'kroha'
Global $site='localhost/48events'
;TMP:
Global $odno = @ScriptDir&'/odno.tmp'
Global $a = 0
_LogIn()
_GetFriends()
While 1
$msg = GUIGetMsg()
Select
  Case $msg = $GUI_EVENT_CLOSE
   ExitLoop
EndSelect
WEnd
Func _GetFriends()
$a = $a+1
ConsoleWrite('$a = '&$a)
_IELoadWait($oIE)
FileDelete(@DesktopDir&"/test.txt")
$oLinks = _IELinkGetCollection($oIE)
$iNumLinks = @extended
ConsoleWrite('  2. Links Found: ' & $iNumLinks & @CRLF)
  For $oLink in $oLinks
If IsObj($oLink) == 0 Then
  MsgBox(0,'','that is not obj')
Elseif IsObj($oLink) == 1 Then
  ConsoleWrite('$oLink is Object'&@CRLF)
Else
  ConsoleWrite('i don"t know'&@CRLF)
EndIf
   FileWrite($odno, $oLink.href & @CRLF)
   $check = _StringBetween($oLink.href, "chatWith=", "&tkn=")
   If not @error then FileWrite(@DesktopDir&'/friends.txt',$oLink.href&@CRLF)
   $check = _StringBetween($oLink.href, "st.page=","&tkn=")
   If not @error Then
    $string=_ArrayToString($check)
    If $a < 9 Then
     $result = StringLeft($string, 1)
    Else
     $result = StringLeft($string, 2)
    EndIf
    If $result > $a Then
     ConsoleWrite ('I found it: '&$result& ' link: ' & $oLink.href & @CRLF)
     _IENavigate($oIE,$oLink.href)
     _GetFriends()
    EndIf
   EndIf
  Next
EndFunc ; ==> _GetFriends
Func _LogIn()
    ConsoleWrite('1. Navigate to Login Page' & @CRLF)
Local $oForm, $oQuery1, $oQuery2, $oQuery3, $Action
$oIE = ObjCreate("Shell.Explorer.2")
GUICreate("Theo's MD 48events", 320, 480)
$GUIActiveX = GUICtrlCreateObj($oIE, 0,0, 320, 480)
GUISetState()
_IENavigate($oIE,$site)
$sHTML = _IEBodyReadHTML ($oIE)
Local $oForm = _IEFormGetCollection($oIE, 0)
$oQuery1 = _IEFormElementGetObjByName ($oForm, 'fr.login')
$oQuery2 = _IEFormElementGetObjByName ($oForm, 'fr.password')
$oQuery3 = _IEFormElementGetObjByName ($oForm, 'button_login')
_IEFormElementSetValue ($oQuery1, $iUser )
_IEFormElementSetValue ($oQuery2, $iPsw)
$Action = _IEAction($oQuery3,"click")
  _IELoadWait($oIE)
    ConsoleWrite('1. Navigate to Main Page' & @CRLF)
Local $oLinks = _IELinkGetCollection($oIE)
Local $iNumLinks = @extended
ConsoleWrite('1. Links Found: ' & $iNumLinks & @CRLF)
For $oLink In $oLinks
  $check = _StringBetween($oLink.href, "userFriends&st", ".roe")
  If not @error Then
   ConsoleWrite('1. Navigate to Friend Link = ' & $oLink.href & @CRLF)
   $oIE.Navigate($oLink.href)
  EndIf
Next
_IELoadWait($oIE)
$oLinks = _IELinkGetCollection($oIE)
$iNumLinks = @extended
ConsoleWrite('1. Links Found: ' & $iNumLinks & @CRLF)
For $oLink In $oLinks
  $check = _StringBetween($oLink.href, "userFriends&st.snd=", "tkn=")
  If not @error then
   ConsoleWrite('1. Navigate to All Friends = ' & $oLink.href & @CRLF)
   $oIE.Navigate($oLink.href)
  EndIf
Next
EndFunc ; ==> _LogIn

Also sorry that i don't have the link coz web site is on my local computer..

I just try to increasing my knowledge of Autoit and try to parsing part of my database..

If you seen i have used this code:

Local $oLinks = _IELinkGetCollection($oIE)
Local $iNumLinks = @extended
ConsoleWrite('1. Links Found: ' & $iNumLinks & @CRLF)
For $oLink In $oLinks
  $check = _StringBetween($oLink.href, "userFriends&st", ".roe")
  If not @error Then
   ConsoleWrite('1. Navigate to Friend Link = ' & $oLink.href & @CRLF)
   $oIE.Navigate($oLink.href)
  EndIf
Next

too many times.. i try to find something more usability what will incise the performance,

i don't know what to do.. to make new func.. or to find some formula.. no ideas..

Thanks you for any tip, and restoring my post :oops:

[center][font=courier new,courier,monospace]Die die die my darling[/font][/center][center][font=courier new,courier,monospace]Don't utter a single word[/font][/center][center][font=courier new,courier,monospace]Die die die my darling[/font][/center][center][font=courier new,courier,monospace]Just shut your pretty mouth[/font][/center][center][font=courier new,courier,monospace]I'll be seeing you again[/font][/center][center][font=courier new,courier,monospace]I'll be seeing you[/font][/center][center][font=courier new,courier,monospace]In hell[/font][/center]

Link to comment
Share on other sites

Login automation is not allowed here (please check the forum rules).

As I mentioned on the other please explain what you try to do so we can see if we can help you.

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

toader,

Please in the future don't PM a member to look at your post, because I always aim to respond to a post even if I'm unable to answer their question.

Back on topic...now you've posted more code and I can see what you're doing I think you should read the Forum rules before you continue, because login automation is forbidden to be discussed on the forum.

Edited by guinness

UDF List:

 
_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_ArrayFilter/_ArrayReduce_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 22/04/2018

Link to comment
Share on other sites

Ok, thanks guys..

[center][font=courier new,courier,monospace]Die die die my darling[/font][/center][center][font=courier new,courier,monospace]Don't utter a single word[/font][/center][center][font=courier new,courier,monospace]Die die die my darling[/font][/center][center][font=courier new,courier,monospace]Just shut your pretty mouth[/font][/center][center][font=courier new,courier,monospace]I'll be seeing you again[/font][/center][center][font=courier new,courier,monospace]I'll be seeing you[/font][/center][center][font=courier new,courier,monospace]In hell[/font][/center]

Link to comment
Share on other sites

  • Moderators

toader,

I take it that last post is an admission that your code does indeed break the Forum rules, so...... :oops:

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share

×
×
  • Create New...