
DCCD
Active Members-
Posts
310 -
Joined
-
Last visited
Everything posted by DCCD
-
Hi First time used webdriver udf i use A simple code to open and refresh the page Everything is excellent except for one thing there's a website using CAPTCHA (see the attach pic) The problem when the website is opened via WD -(firefox)-, the CAPTCHA on the website fails! But when I use firefox normally it is confirmed successful hope someone help solve the problem and explains to me why it happened. #include <MsgBoxConstants.au3> #include <wd_core.au3> #include <wd_helper.au3> #include "wd_capabilities.au3" ; Here you can specify some browser specific settings... you'll need to research them depending on your browser ; ... or just copy paste someone else's code :D #Region Settings Setup _WD_Option('Driver', 'geckodriver.exe') _WD_Option('DriverParams', '--log trace') _WD_Option('Port', 4444) _WD_CapabilitiesAdd('args', '--headless') Global $sDesiredCapabilities = '{"desiredCapabilities":{"javascriptEnabled":true,"nativeEvents":true,"acceptInsecureCerts":true}}' #EndRegion Settings Setup ; You need to initialize some stuff with this UDF _WD_Startup() ; If there is an error setting stuff up, then exit If @error <> $_WD_ERROR_Success Then Exit -1 EndIf Sleep(10000) ; Create a new instance of a browser with some settings you request Global $sSession = _WD_CreateSession($sDesiredCapabilities) ; If there was an error, exit If Not (@error = $_WD_ERROR_Success) Then Exit MsgBox($MB_ICONERROR, "Error: _WD_CreateSession", "Failed to create a Session. Check your desired capabilities.") ; Move to the requested website _WD_Navigate($sSession, "URL") _WD_LoadWait($sSession,500,500,500,500) _WD_Action($sSession, 'REFRESH') MsgBox($MB_ICONINFORMATION, "Navigation completed!", _WD_Action($sSession, 'TITLE')) If @error Then MsgBox($MB_ICONINFORMATION, "Navigation completed!", _WD_LastHTTPResponse()) EndIf ; This removes the browser instance _WD_DeleteSession($sSession) ; And this cleans up some resources _WD_Shutdown()
-
Hi, how to get full error reporting if FTP failed? tried _WinAPI_GetLastErrorMessage() func but That didn't help at all. the information was returned by _WinAPI_GetLastErrorMessage() can't help me! _FTP_Open, return Success: a handle, Failure: 0 and sets the @error flag to non-zero _FTP_Connect, return Success: an handle to connected session. Failure: 0 and sets the @error flag to non-zero. _FTP_DirCreate, return Success: 1. Failure: 0. _FTP_FilePut, return Success: 1. Failure: 0 and sets the @error flag to non-zero. Any help would be much appreciated
-
RegWrite on 32-bit and 64-bit Windows
DCCD replied to DCCD's topic in AutoIt General Help and Support
Thanks a lot, i really appreciate your help, ... i just ask because Autoit Help file says As you said no need to change anything here HKEY_CURRENT_USERSoftwareMicrosoftWindowsCurrentVersionRun . -
Hi, is this the right way to use RegWrite func on 32-bit and 64-bit Windows $HKEY_CURRENT_USER = 'HKEY_CURRENT_USER64' If @OSArch = 'X86' Then $HKEY_CURRENT_USER = 'HKEY_CURRENT_USER' RegWrite($HKEY_CURRENT_USER & '\Software\Microsoft\Windows\CurrentVersion\Run', 'Obd2Diag', 'REG_SZ', 'app') Thanks in advance
-
replace multiple strings in 100mb file
DCCD replied to DCCD's topic in AutoIt General Help and Support
@SmOke_N, Thank you for all your help and I apologize for the late response- 9 replies
-
- StringReplace
- _ReplaceStringInFile
- (and 3 more)
-
replace multiple strings in 100mb file
DCCD replied to DCCD's topic in AutoIt General Help and Support
each text string need to be replaced may contain more than 500 characters/numbers.- 9 replies
-
- StringReplace
- _ReplaceStringInFile
- (and 3 more)
-
replace multiple strings in 100mb file
DCCD replied to DCCD's topic in AutoIt General Help and Support
@SmOke_N, thanks a lot, I'll try something different, thanks again for all your help- 9 replies
-
- StringReplace
- _ReplaceStringInFile
- (and 3 more)
-
replace multiple strings in 100mb file
DCCD replied to DCCD's topic in AutoIt General Help and Support
Thank you all, i really appreciate your help and support , actually i'm still stuck in this slow loop I've tried many ways and it isn't working- 9 replies
-
- StringReplace
- _ReplaceStringInFile
- (and 3 more)
-
Hi, i wrote a script that can replace multiple strings in a xml file works fine but so slow! I've used StringReplace ,_ReplaceStringInFile, StringRegExpReplace, all the same very slow,. The number of replacements in the file about 8000 Any help would be greatly appreciated #include <File.au3> $path = @ScriptDir & '\xmlfo.xml' $OXML = FileOpen($path, 256) $XML = FileRead($OXML) $term = 'post' $nofr = 1 Local $aArray = StringRegExp($XML, '(?s)<entry[^>]*>.*?</entry>', 3) FileClose($OXML) $XL = $XML If Not @error Then For $i = 0 To UBound($aArray) - 1 ;get data start ;ConsoleWrite ( $aArray[0] &' '&$i& @CRLF) $date = StringRegExp($aArray[$i], '(?i)<published>(.*?)</published>', 3) If @error Then $date = StringRegExp("date err", "(.{33,}?(?:\s)|.+)", 3) ElseIf Not @error Then ;ConsoleWrite($date[0] & ' ' & $i & @CRLF) EndIf $kind = StringRegExp($aArray[$i], '(?i)<category>(.*?)</category>', 3) If @error Then $kind = StringRegExp("kind err", "(.{33,}?(?:\s)|.+)", 3) ;ConsoleWrite ( $kind[0] &' '&$i& @CRLF) ElseIf Not @error Then ;ConsoleWrite ( $kind[0] &' '&$i& @CRLF) EndIf If $kind[0] = $term And Data(getdate($date[0], 'year'), getdate($date[0], 'month')) = True Then _ReplaceStringInFile($path, $aArray[$i], '') If Not @error Then ;MsgBox(16,'',$XL) ConsoleWrite($nofr & ' ' & $i & @CRLF) $nofr = $nofr + 1 EndIf ;FileDelete(@ScriptDir & '\XML_output.xml') ;FileWrite (@ScriptDir & '\XML_output.xml', StringToBinary ( StringReplace($temp, $aArray[$i], "") , 4) ) Else ConsoleWrite ('err0x0'& @CRLF) EndIf Next EndIf
- 9 replies
-
- StringReplace
- _ReplaceStringInFile
- (and 3 more)
-
i don't know about xml udf!, i was using Autoit help file to find some func/example.
-
jguinch & SmOke_N, i really appreciate your help thank you very much to both of you
-
Hi, i need help here's a xml file i need to check some data in the xml file but the second StringRegExp return 0 why? Here's the XML file <entry xmlns="http://www.w3.org/2005/Atom"> <id>885454</id> <published>2013-11-10T21:53:00.001+02:00</published> <updated>2015-01-11T05:13:52.877+02:00</updated> <category scheme="kind" term="post" /> <title type="text">TITLE</title> <content type="html" /> <link rel="replies" type="application/atom+xml" href="/comments/default" title="Post Comments" /> <link rel="replies" type="text/html" href="/comment-form" title="0 Comments" /> <link rel="edit" type="application/atom+xml" href="/" /> <link rel="self" type="application/atom+xml" href="/" /> <link rel="alternate" type="text/html" href="/" title="TITLE" /> <thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total> </entry> Autoit Script $XML = FileRead(@ScriptDir & '\default.xml') Local $nOffset = 1 Local $aArray While 1 $aArray = StringRegExp($XML, '(?s)<entry[^>]*>.*?</entry>', 1, $nOffset) If @error = 0 Then $nOffset = @extended Else ExitLoop EndIf For $i = 0 To UBound($aArray) - 1 ;ConsoleWrite($aArray[$i]) ConsoleWrite(StringRegExp($aArray[$i], '(?i)<published>(.*?)</published>', 1, $nOffset)); return 0! Next WEnd Any help would be greatly appreciated .
-
Win32/Injector.JRX trojan
-
What's going on here? 82 replies, 1,855 views That's a lot of views in 2 days!
-
your udf seems has a lot of requirements Xp_SP3 AutoIt_v3.3.8.1 DirectX 9.0c Yes, Mobile Intel® 915GM/GMS,910GML Express Chipset Family
-
-
That's AutoIt's world sometimes between your hands sometime between your *** ,actually, i have a lot of ways but not so good, something like using window's hWnd to fetch the pixel size the return can be compared to the pixel size of the screen. but as i told you before that not so good, Ex. when play video in full screen BOOOOOOM.....
-
FlashWindowEx function flashes the specified window, btw already exists on WinAPI library called _WinAPI_FlashWindowEx, and about detect flashing window, I think RegisterShellHookWindow function can do the job. seeya.
-
Try this you can put the results into INI file or something like that! #include <String.au3> Local $aArray1 = _StringBetween(StringReplace(BinaryToString(InetRead("http://weather.yahooapis.com/forecastrss?w=2449808")), '"', ""), 'yweather:forecast', 'code') MsgBox(0, '', $aArray1[0])
-
As the title how to detect 3D application? Thanks.
-
Ahh, battery dead..
-
let's say you wanna put your code in a text file called 'Test.txt' To run the code in Test.txt use this $TextFile = "Test.txt" RunWait('"' & @AutoItExe & '" /AutoIt3ExecuteScript ' & $TextFile) You have to see Running Scripts in the help file
-
Did you get any error messages? Try this #include <Excel.au3> Local $sFilePath1 = @ScriptDir & "zzzzd.xls" ;This file should already exist If Not FileExists($sFilePath1) Then MsgBox(16, '', 'Does NOT exists') Exit EndIf Local $oExcel = _ExcelBookOpen($sFilePath1)
-
Yes, you can do that.