stever 10 Posted September 30, 2017 Report Share Posted September 30, 2017 I am trying to create a bot to log in to the Hatena Japanese social bookmarking website. This is the script: clear cookiesset user agent("Firefox 6")navigate("https://www.hatena.ne.jp/login?location=http%3A%2F%2Fh.hatena.ne.jp%2F","Wait")wait for element(<full name field>,"","Appear")wait(3)type text(<full name field>,"testerUBOT","Standard")wait(3)type text(<password field>,"ubotter1","Standard")wait(3)click(<type="submit">,"Left Click","No") The login name is testerUBOT and the p/w is ubotter1. The problem is that the site seems to know that the login click is not a natural click and it takes you off on a wild goose chase. If you stop the script before the login button is clicked and click the button manually in the browser, everything is fine. Anyone know what's going on and is there a solution (without forking out for exbrowser)? (I've tried switching from Chrome 49 to Chrome 21 but it makes no difference) Thank youSteve Quote Link to post Share on other sites
Code Docta (Nick C.) 638 Posted September 30, 2017 Report Share Posted September 30, 2017 set user agent("Firefox 6") is super old and does not work in chrome 49 try set header("User-Agent","Mozilla/5.0 (Windows NT 10.0; WOW64; rv:56.0) Gecko/20100101 Firefox/56.0") for chrome 49 or another recent browser UA You can also use "windows commands" to simulate mouse click. but that will take over your mouse...I would recommend exbrowser as you have more options. Save some money. Regards,CD 1 Quote Link to post Share on other sites
Varo 28 Posted October 1, 2017 Report Share Posted October 1, 2017 i am using Chrome 49 and default User Agent.Everything is fine. Login succeed. navigate("https://www.hatena.ne.jp/login?location=http%3A%2F%2Fh.hatena.ne.jp%2F","Wait") wait for browser event("Everything Loaded","") type text(<full name field>,"testerUBOT","Standard") wait(1) type text(<password field>,"ubotter1","Standard") wait(1) click($element offset(<login button>,0),"Left Click","No") 2 Quote Link to post Share on other sites
Code Docta (Nick C.) 638 Posted October 1, 2017 Report Share Posted October 1, 2017 Exactly my point, using an updated browser and/or user agent. The old browsers Firefox 9 and chrome 21 are almost obsolete. 1 Quote Link to post Share on other sites
stever 10 Posted October 1, 2017 Author Report Share Posted October 1, 2017 Thank you for the replies. Seems like the issue was around the element I selected for clicking to login: silly mistake on my part. Thanks again: I learned something about headers and user agents so will use that from now on. 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.