Jump to content

tonyrocks

Active Members
  • Posts

    20
  • Joined

  • Last visited

Everything posted by tonyrocks

  1. Hello somdcomputerguy, Yes, I have each page with a specific name. @jdelaney I'm going to check those out! Thanks! -Tony
  2. So i've been tasked with logging into a site with IE, and then look at a text file that contains a list of URLs on the site to crawl. I need to crawl each URL, save the HTML to a specified file name, then go to the next URL and repeat the process. So far I am able to login to the site in IE with this: #include <ie.au3> #include <INet.au3> #include <MsgBoxConstants.au3> $uname="tony" $pwd="tony" ; Get ready to login! $oIE = _IECreate ("http://localhost/books/login.aspx") $oForm = _IEFormGetObjByName ($oIE, "form1") $oQuery1 = _IEFormElementGetObjByName ($oForm, "userNameTextBox") $oQuery2 = _IEFormElementGetObjByName ($oForm, "passwordTextBox") ; Start sending form values and then simulate a click to login _IEFormElementSetValue ($oQuery1,$uname) _IEFormElementSetValue ($oQuery2,$pwd) $oButton=_IEGetObjById($oIE,"loginButton") _IEAction ($oButton, "click") _IELoadWait($oIE,0) That gets me to login. My text file (c:urls.txt) looks like this: http://localhost/books/book1.html http://localhost/books/book2.html http://localhost/guies/book1.html I have to then open IE up to the first URL, then Save file AS something, then go to the next one. Any suggestions? Thanks! -Tony
  3. Oh wait, found the problem. Apparently there is a problem with using WIndows Server 2008, I have to put this at the top: _GDIPlus_Startup("gdiplus.dll")
  4. ok, I upgraded my AutoIt and I no longer get the error. However after I select the source folder and then the destination folder, nothing seems to happen. The interface dismisses with no message saying that files are being processed.
  5. I am using 3.3.10.2. looks like i'm a little behind?
  6. Very nice looking! When running it though I get an error on line 24: Error: Variable used without being declared.
  7. So, not to re-open my own post, but I had some questions about mult-page montages. I can call montage command with no problem, however I have a folder of about 1000 images. Is there a AutoIt script that can go through and take 6 files, make a montage image called montage1.jpg and then take the next 6 and name it montage 2.jpg and so on? Thanks! -Tony
  8. whoa! very cool. I plum forgot about ImageMagick. Thanks! -Tony
  9. Is there a way to create a contact sheet of pictures from a folder? For example, i have a folder of 12 pictures. I would like to place 4 pictures on one page until i reach 12 pictures total. In this case there would be three separate jpgs. Is this possible? Thanks!
  10. I just had an RTFM moment Thanks Autolaser
  11. I'm having a blast capturing images of IE using AutoIT. _ScreenCapture_Capture("C:\blap\" & $alarmName) However I only want to capture just the browser window...not a region, not the whole screen (which includes my Windows start menu and other icons). Is there some switch that says only capture immediate window? Thanks! -Tony
  12. Ok, so what i did was just add some text (zap...yeah, very creative, i know). And used the: _IELinkClickByText($oIE, "zap") This works and brings up a dynamically generated pop-up (div, not javasript alert). I want to then click a link on that pop-up that says "Accept." Clicking that link disposes of that pop-up. However I this doesn't work:# #include <IE.au3> #include <MsgBoxConstants.au3> Local $oIE = _IECreate("http://localhost/myapp") ; Display messages _IELinkClickByText($oIE, "zap") ;wait _IELoadWait ($oIE, 20, 3000) ;Click the accept button on pop-up. After clicking Accept, the pop-up goes away _IELinkClickByText($oIE, "Accept") It doesn't seem to know how to click Accept. Am I missing something?
  13. I'm in the process of writing a script that clicks on the first link in a list, which brings up another pop-up and then closes that pop up. The previous first link disappears and is replaced with the next in line...repeat process. My problem is this, I cannot seem to figure out how to click the link, which contains no text, but appears to be using some css to display an image. Below is the example row with a link: <div class="action"><a class="button-small" href="#"><span class="category system"></span></a></div> I'm thinking I could use something with _IELinkClickByText($oIE, "#") ...but not sure. Thanks! -Tony
  14. UEZ, Perfect! That was it. Thanks! -Tony
  15. I'm not sure what the deal is, but all I want to do is take a screen capture from a Webpage and Save it as jpg: #include <ScreenCapture.au3> Example() Func Example() ; Capture full screen _ScreenCapture_Capture("C:\blap\GDIPlus_Image1.jpg") ShellExecute("C:\blap\GDIPlus_Image1.jpg") ; Capture region _ScreenCapture_Capture("c:\blap\GDIPlus_Image2.jpg", 0, 0, 796, 596) ShellExecute("c:\blap\GDIPlus_Image2.jpg") EndFunc ;==>Example But I always get a error pop-up that says: Windows cannot find 'C:blapGDIPlus_Image1.jpg'. Make sure you typed the name correctly, and then try again. I am using Windows Server 2008. Maybe it is a permissions thing? Thanks!
  16. ok! I've got it. I did this: #include <IE.au3> Local $oIE = _IECreate("http://www.tonyrocks.com/fit/guess.htm", 0, 0, 1, 0) Local $ospans = _IETagNameGetCollection($oIE, 'span') For $ospans In $ospans If $ospans.className == "logo" Then MsgBox(0, "suceed", $ospans.title); EndIf Next So yes, technically it works, but I think the loop is overkill
  17. OH great! I'm on the right path. I've fixed the source of guess.htm. This solutions works for me, except for one thing, I will have multiple span tags with titles. The one I want to retrieve in particular has a class attribute value of logo. For example: <html> <body><div class="body">Hey there, this is a test! <span class="logo" title="this is the logo area"><img src="http://www.tonyrocks.com/logo.png"></span></div> <span class="secondary" title="secondary">this is all secondary</span></div> </body> </html> Thanks!
  18. I am in need of hitting a website to check the value of a span tag title attribute. I'm pulling my hair out trying to figure out the best way of doing this. I need to hit this page (just as an example) http://www.tonyrocks.com/fit/guess.htm which contains this: <html> <body><div class="body">Hey there, this is a test! <span class="logo" title="this is the logo area"><img src="http://www.tonyrocks.com/logo.png"></span></div> </body> </html> I just need to grab the text 'this is the logo area' and store it in a variable ($spanTitle for example) and then use it with the rest of my script. I don't want to over complicate it, not sure if I use curl, InetGet or what or even how to start with the AutoIt code. Thanks as usual! -tony
  19. wow...awesome. This is exactly what I needed! Much simpler than what I could have imagined.
  20. I'm really wanting to change the values that are set in a default Web.config file (created by my .NET developers) and then save it. The keys are typically specific to their local machines. I want to take what they send me and change the attribute value. Here is my Web.config: <?xml version="1.0" encoding="utf-8"?> <configuration> <configSections> <section name="infragistics.web" type="System.Configuration.SingleTagSectionHandler,System, Version=1.0.3300.0, Culture=neutral" /> <!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 --> </configSections> <appSettings> <add key="LocalProdmode" value="None" lockItem="false" /> </appSetting> <connectionStrings> <add name="ProdDatabase" connectionString="Data Source=localhost;Initial Catalog=Products;Trusted_Connection=False;User ID=productadmin;Password=apple123;" /> <add name="Prod.box.Web" connectionString="Data Source=localhost;Initial Catalog=Products;Trusted_Connection=False;User ID=productadmin;Password=apple123;" /> </connectionStrings> <system.diagnostics> <trace> <listeners> <add initializeData="c:\logs\products.Log" type="Prod.Diagnostics.LogTraceListener, Prod" name="Prod.box.log" traceOutputOptions="DateTime, Timestamp, ProcessId, ThreadId"> <filter type="System.Diagnostics.EventTypeFilter" initializeData="Information" /> </add> </listeners> </trace> </system.diagnostics> </configuration> What I need to do is changed the line: <add key="LocalProdmode" value="None" lockItem="false" /> to <add key="LocalProdmode" value="555" lockItem="true" /> and I need to change the lines: <add name="ProdDatabase" connectionString="Data Source=localhost;Initial Catalog=Products;Trusted_Connection=False;User ID=productadmin;Password=apple123;" /> <add name="Prod.box.Web" connectionString="Data Source=localhost;Initial Catalog=Products;Trusted_Connection=False;User ID=productadmin;Password=apple123;" /> to <add name="ProdDatabase" connectionString="Data Source=172.16.18.2;Initial Catalog=ProductsProd4;Trusted_Connection=False;User ID=admin;Password=orange123;" /> <add name="Prod.box.Web" connectionString="Data Source=l72.16.18.2;Initial Catalog=ProductsProd3;Trusted_Connection=False;User ID=admin;Password=orange123;" /> and finally I need to change the line: <add initializeData="c:\logs\products.Log" type="Prod.Diagnostics.LogTraceListener, Prod" name="Prod.box.log" traceOutputOptions="DateTime, Timestamp, ProcessId, ThreadId"> to <add initializeData="c:\productionlog\products.Log" type="Prod.Diagnostics.LogTraceListener, Prod" name="Prod.quad.log" traceOutputOptions="DateTime, Timestamp, ProcessId, ThreadId"> and then overwrite (or even save) the file with the changes. I'm guessing I have to use something like #include <_XMLDomWrapper.au3> or something? I'm hoping and AutoIt can help me. I wish I could have found this tool earlier in my career! -Tony
×
×
  • Create New...