stan beck 0 Posted April 6, 2012 Report Share Posted April 6, 2012 UBot Newbie here - just asking for some general direction... I need to create a bot which performs repetative tasks in wordpress - basically cycling through every post and clicking a button. I need a loop. The only thing that I can tell on the Wordpress post page is when it comes to the last page, the right 'arrow' buttons (one is 1 page forward and the 2nd is to the end) are greyed out. Not sure how to harness that yet. I also need to click on each link to go into the post. Then I need to click on the the target button. Then I need to exit out of that post and go to the next and repeat, until it gets to the last listing on a page, and then it needs to click the right arrow to go to the next page. Thank you. Regards, Stan Quote Link to post Share on other sites
JohnB 255 Posted April 7, 2012 Report Share Posted April 7, 2012 Hi Stan. Are you talking about interacting with the front end of WP blogs or the backend? John Quote Link to post Share on other sites
stan beck 0 Posted April 15, 2012 Author Report Share Posted April 15, 2012 Hi John, This is all backend work... When I scrape a page of links, they, as a whole, are inserted into a single list array item (http://screencast.com/t/WAFKkS9N). So, when I want to traverse through the list to visit the links (in my case), it navigates to a full string of urls, which will never resolve... Here is my code for your kind consideration... define initialize everything { clear list(%LPN Page Links) clear cookies}define navigate to and login { navigate("http://sanantonio.emergencyacservice.com/wp-admin", "Wait") type text(<username field>, "admin", "Standard") type text(<password field>, "adminfakepassword", "Standard") click(<login button>, "Left Click", "No") wait(3) click($element offset(<class="wp-has-submenu wp-not-current-submenu menu-top menu-icon-local-page">, 1), "Left Click", "No")}define scrape lpn links { wait(5) loop(4) { wait(4) add item to list(%LPN Page Links, $scrape attribute(<outerhtml=w"<a href=\"http://*/wp-admin/post.php?post=*&action=edit\" title=\"Edit this item\">Edit</a>">, "fullhref"), "Don\'t Delete", "Global") wait(2) click($element offset(<class="next-page">, 0), "Left Click", "No") } wait(3)}define process lpn links { loop(2) { navigate($next list item(%LPN Page Links), "Wait") }}dividerinitialize everything()navigate to and login()scrape lpn links()process lpn links() Thanks very much! Stan Quote Link to post Share on other sites
stan beck 0 Posted April 17, 2012 Author Report Share Posted April 17, 2012 Any thoughts? Quote Link to post Share on other sites
JohnB 255 Posted April 17, 2012 Report Share Posted April 17, 2012 Change add item to list to add list to list. John Quote Link to post Share on other sites
stan beck 0 Posted April 17, 2012 Author Report Share Posted April 17, 2012 Change add item to list to add list to list. John Hi John, Thanks for the response. I don't quite understand. 'Add List to List' requires 2 lists, does it not? - I'm scraping urls from a page and adding them to a list. When I put in the 'Add List to List', the only paramaters/options I have is a list (top and bottom) - I tried to put in a '$scrape attribute', but it's not taking it. I must be missing something. Thanks, Stan Quote Link to post Share on other sites
stan beck 0 Posted April 17, 2012 Author Report Share Posted April 17, 2012 Hi John, Thanks for the response. I don't quite understand. 'Add List to List' requires 2 lists, does it not? - I'm scraping urls from a page and adding them to a list. When I put in the 'Add List to List', the only paramaters/options I have is a list (top and bottom) - I tried to put in a '$scrape attribute', but it's not taking it. I must be missing something. Thanks, Stan Nevermind, it's taking the scrape attribute afterall - not sure what I was doing before... Quote Link to post Share on other sites
JohnB 255 Posted April 17, 2012 Report Share Posted April 17, 2012 Ok...it definitely works....whenever you use add item to list, even if you have 1000 items it treats them as a single item. John 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.