hanapco 0 Posted July 18, 2012 Report Share Posted July 18, 2012 I'm trying out ubot and decided to create an ads poster for gumtree australia. I'm having two problems1. I'm getting a validation error when I run preview but I know all required fields where entered, looks like gumtree can tell it's a bot because if i enter same details manually I can go to preview.2. How can I automate the picture upload, the way it works is a file browser shows and after choosing file it's uploaded as soon as it is selected. Tried the change file but didn't work. Thanks for any help ui text box("email", #username) ui text box("Password", #password) set user agent("Firefox 6") navigate("https://www.gumtree.com.au", "Wait") wait for browser event("Everything Loaded", "") if($exists(<innertext="Sign Out">)) { then { click(<innertext="Sign Out">, "Left Click", "No") wait for browser event("Page Loaded", "") } else { } } click(<login link>, "Left Click", "No") wait for element(<email field>, "", "Appear") type text(<email field>, #username, "Standard") wait(1) type text(<password field>, #password, "Standard") wait(1) click(<login button>, "Left Click", "No") wait for element(<innertext="Post an ad">, "", "Appear") click(<innertext=w"Post an ad* ">, "Left Click", "No") wait for element(<class="green-bkg-title rounded-top-corners3">, "", "Appear") click(<outerhtml="<a id=\"cat_9298\" class=\"p-pstctgry-lnk-ctgry \" href=\"#\">Stuff for Sale</a>">, "Left Click", "No") wait for element(<id="cat_18625">, "", "Appear") click(<id="cat_18625">, "Left Click", "No") wait for element(<id="typ_OFFER">, "", "Appear") wait for element(<outerhtml="<span>Go</span>">, "", "Appear") wait(2) click(<outerhtml="<button class=\"green-button\" type=\"submit\"><span>Go</span></button>">, "Left Click", "No") wait for element(<innertext="Ad Details">, "", "Appear") type text(<name="price.amount">, 150, "Standard") wait(2) type text(<name="title">, "Bose For Sale", "Standard") wait(2) type text(<name="description">, "Bose around-ear headphones give you best-seat-in-the-house performance.", "Standard") wait(2) type text(<address line1 field>, "Adelaide SA 5000", "Standard") wait(2) click(<id="pstad-frmprview">, "Left Click", "No") Quote Link to post Share on other sites
JohnB 255 Posted July 19, 2012 Report Share Posted July 19, 2012 You have to make sure the image is the right format. Works fine for me when I use png, or jpeg... John Quote Link to post Share on other sites
mydearcosmo 1 Posted July 19, 2012 Report Share Posted July 19, 2012 Will GIF format works especially for those ads that are moving? Quote Link to post Share on other sites
JohnB 255 Posted July 19, 2012 Report Share Posted July 19, 2012 It looks like it, yes: http://screencast.com/t/p2tiK0MN John Quote Link to post Share on other sites
hanapco 0 Posted July 19, 2012 Author Report Share Posted July 19, 2012 JohnB, were you able to preview even without the file upload? Thanks I'm getting <h3>Oops! You haven't finished filling the form in</h3> Quote Link to post Share on other sites
hanapco 0 Posted July 19, 2012 Author Report Share Posted July 19, 2012 ok i have missed a step. all is ok now Quote Link to post Share on other sites
Toxic Chili 2 Posted July 19, 2012 Report Share Posted July 19, 2012 JohnB, were you able to preview even without the file upload? Thanks I'm getting <h3>Oops! You haven't finished filling the form in</h3> Have you managed to get this to work yet? I tried this on the au gumtree site and it seemed to work find for the image upload. change file field(<name="file">, #image_file) I have a UK Gumtree bot which is working fine, although every now and then they change something so it can't login. Have had to change the bot twice so far because of this. Quote Link to post Share on other sites
Toxic Chili 2 Posted July 19, 2012 Report Share Posted July 19, 2012 ok i have missed a step. all is ok now Didn't see this post, glad it works okay now :-) Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.