Scottswan Posted November 29, 2004 Share Posted November 29, 2004 I'm looking for some direction on how I can locate (with a script) a button on a web page and then activate it. Primarily on Ebay. I'm working on an auction sniper script (don't worry, I'll share) but I would like to make it portable if possible. The only problem I'm stuck on is how to 'hit' the bid button. Mouse position would work fine for just me as the button is always in the same spot as long as I don't change anything with my default browser. Tab's won't work, I tried that. Top links change depending upon what area the auction is located in. Parse the page source maybe? I have no idea how. -Scott Link to comment Share on other sites More sharing options...
sugi Posted November 29, 2004 Share Posted November 29, 2004 With AutoIt there's no easy way to do this. Everything that's possible is a dirty workaround. Link to comment Share on other sites More sharing options...
Scottswan Posted November 29, 2004 Author Share Posted November 29, 2004 With AutoIt there's no easy way to do this. Everything that's possible is a dirty workaround.<{POST_SNAPBACK}> I was hoping for a "oh ya, thats cake! Just do this... clickity clickBummer. Link to comment Share on other sites More sharing options...
para Posted November 29, 2004 Share Posted November 29, 2004 Wouldn't Controlclick do the job? just put it on the text and the window title(partial of course)? hope that helped Link to comment Share on other sites More sharing options...
erebus Posted November 29, 2004 Share Posted November 29, 2004 Wouldn't Controlclick do the job? just put it on the text and the window title(partial of course)? hope that helped<{POST_SNAPBACK}>Control functions have no luck with IE because of its structure. Try by sending keystrokes (i.e. tab-tab-tab-enter) if you want to click on the proper button. Link to comment Share on other sites More sharing options...
Scottswan Posted November 29, 2004 Author Share Posted November 29, 2004 Wouldn't Controlclick do the job? just put it on the text and the window title(partial of course)? <{POST_SNAPBACK}>Thanks for the suggestion.Unfortunetly ControlClick looks for a control button on a standard windows GUI. The 'Place Bid' button on ebay is actually a form-input/submit button and doesn't have any kind of CLSID that AutoIt can hone in on.Actually, looking at the Form code for a Place Bid button on Ebay, I can't even work around the html.....the button HAS to be clicked no matter what.~sigh~Plan B:Back to my mouse position idea.... I may be able to write a setup script for this so the user can 'show' the script where to click on the button in their own default browser. If the script remembers it, and the user doesn't change anything with thier browser, it might just work!-Scott Link to comment Share on other sites More sharing options...
erebus Posted November 29, 2004 Share Posted November 29, 2004 the button HAS to be clicked no matter what.Yes but buttons can also be "pressed" using the keyboard as I told you instead of "clicked" with the mouse. Why don't you try this?Back to my mouse position idea.... I may be able to write a setup script for this so the user can 'show' the script where to click on the button in their own default browser. If the script remembers it, and the user doesn't change anything with thier browser, it might just work!If you want to try this, you may want to write a script that:a. Opens the URL in a maximized browser's windowb. Moves the mouse to a specific x,y position and rightclicks. Link to comment Share on other sites More sharing options...
t0ddie Posted November 29, 2004 Share Posted November 29, 2004 (edited) autoit is not the end-all of scripting languages it isnt a FULL scripting language i use autoit for pretty much everything, but it sucks when i cant manipulate things on websites. you should use autoit and another language combined. im starting to learn other languages myself. its frustrating and time consuming but its the only way. when you use the mouse or the keyboard, the script can be thrown off in ANY number of ways. not to mention, just changing your favorites, or toolbar, or anything will throw the script off. and if you move the mouse or touch the keyboard while its running, sooo frustrating! EDIT: i have made a few "dirty" scripts this way, blockinput for all code executed except when keystrokes and mouseclicks are sent. and alot of times, sending keys works instead of clicking. try a few of these, but it really depends on the application you are manipulating. y = yes {space} = yes {enter} = yes n = no {right}{space} = no {right}{enter} = no next page = {space} next page = {enter} save = s run = r there are many different keystrokes that will be the same as clicking a button. these are just a few examples. make sure you dont block input when sending because some operating systems will also block autoit from sending keystrokes. ~T0ddie Edited November 29, 2004 by t0ddie Valik Note Added 19 October 2006 - 08:38 AMAdded to warn level I just plain don't like you. Link to comment Share on other sites More sharing options...
Valik Posted November 29, 2004 Share Posted November 29, 2004 What makes you qualified to say it isn't a "full" scripting language? Link to comment Share on other sites More sharing options...
scriptkitty Posted November 29, 2004 Share Posted November 29, 2004 You just need to be a bit more creative when working with websites. One nice things is that each time you refresh, or change pages, it grabs the <title>some titile</title> and thus you get the window title changed. (use this to your advantage when waiting for the next page) Also you can use the window resizing functions and pixel searches to find buttons to push. You should also consider using the find feature of your web browser, and use of TAB and SPACE. I integrate many of these, and although dirty, they have proved to be quite stable and have saved me days worth of time. Web Browsers take HTML forms, links, etc and place up visual versions of it. Since they are not actual buttons, fields, forms, etc, you won't be able to use many advanced features AutoIt gives for manipulating forms, buttons, etc. You can also download the webpage, manipulate it, and post back data. Checkout the comic autoit in scraps, or do a search for using AutoIt on web pages. /rant on Before calling AutoIt anything less than a full scripting program, give an example of a "FULL SCRIPTING PROGRAM." and what does it cost? Oh yea, it would need to have every feature autoit has, or it wouldn't be considered Full now would it if it was lacking features autoit has. /rant off AutoIt3, the MACGYVER Pocket Knife for computers. Link to comment Share on other sites More sharing options...
Scottswan Posted November 30, 2004 Author Share Posted November 30, 2004 Also you can use the window resizing functions and pixel searches to find buttons to push.<{POST_SNAPBACK}>Anybody have an example of the pixel search?-Scott Link to comment Share on other sites More sharing options...
scriptkitty Posted November 30, 2004 Share Posted November 30, 2004 Here is one that looks for the yellow pixel on the addreply button. I didn't add any error check, but this might get ya started. Opt("PixelCoordMode", 0) ;1=absolute, 0=relative Opt("MouseCoordMode", 0) ;1=absolute, 0=relative winactivate("AutoIt For") $x=PixelSearch(0,0,700,700,16763904,10,2) MouseMove($x[0],$x[1],1) AutoIt3, the MACGYVER Pocket Knife for computers. Link to comment Share on other sites More sharing options...
Scottswan Posted November 30, 2004 Author Share Posted November 30, 2004 Here is one that looks for the yellow pixel on the addreply button.<{POST_SNAPBACK}>That is hands down the coolest thing I've seen AutoIt do yet!It will definately work well with my Ebay sniper.Hopefully in a week I'll have this done, and I can finally win my much desired PIII 1ghz fgp CPU for under fifty bucks! I've tried about 6 times now to get one and every time someone snipes it out from under me at the last second. I have motivation, now all I need is time.Thanks ScriptKitty, your the -Scott 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