cob007 19 Posted September 3, 2018 Report Share Posted September 3, 2018 I tried several times but somehow can't get the correct xpath to work fo navigating and entering variables using xpath xbrowser in bing mapsset(#Niche,"Plumber","Global")set(#Country,"New York","Global")plugin command("ExBrowser.dll", "ExBrowser Launcher", "Chrome", "", $plugin function("ExBrowser.dll", "$ExBrowser Set User Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.113 Safari/537.36"))plugin command("ExBrowser.dll", "ExBrowser Navigate", "https://www.bing.com/maps?FORM=Z9LH3")plugin command("ExBrowser.dll", "ExBrowser Type Text (Human Delay)", "//*[@id=\"maps_sb\"]", "{#Niche} {#Country}", "", "")plugin command("ExBrowser.dll", "ExBrowser Click", "//*[@id=\"maps_sb_container\"]/div[1]/div") Quote Link to post Share on other sites
Sanjeev 46 Posted September 3, 2018 Report Share Posted September 3, 2018 you need to add a wait for element - for the search box to load set(#Niche,"Plumber","Global")set(#Country,"New York","Global")plugin command("ExBrowser.dll", "ExBrowser Launcher", "Chrome", "", $plugin function("ExBrowser.dll", "$ExBrowser Set User Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.113 Safari/537.36"))plugin command("ExBrowser.dll", "ExBrowser Navigate", "https://www.bing.com/maps?FORM=Z9LH3")plugin command("ExBrowser.dll", "ExBrowser Wait For Element", "//input[@id=\"maps_sb\" and @type=\"search\"]", "Appear", 30)plugin command("ExBrowser.dll", "ExBrowser Type Text (Human Delay)", "//input[@id=\"maps_sb\" and @type=\"search\"]", "{#Niche} {#Country}", "", "")plugin command("ExBrowser.dll", "ExBrowser Click", "//*[@id=\"maps_sb_container\"]/div[1]/div") Quote Link to post Share on other sites
Sanjeev 46 Posted September 3, 2018 Report Share Posted September 3, 2018 https://cl.ly/a0335d34cc87 Quote Link to post Share on other sites
Sanjeev 46 Posted September 3, 2018 Report Share Posted September 3, 2018 Remember, with browser based automation - adding wait for element is essential! As you cannot predict the environment the bot is running in. Especially in the context of bots made for sale where you are not in control. There are so many variables to consider -The biggest issue will be the system resources available to the browser..A bad anti virus program can affect browser's performance,as will the number and the kind of tasks running on the system at the same time - ( how much resources are the other processes consuming?) . wait for element is your constant companion with browser automation- unfortunately! Quote Link to post Share on other sites
cob007 19 Posted September 3, 2018 Author Report Share Posted September 3, 2018 Hi sanjeev, thanks a lot for ur reply, this worked , thanks for ur solution. Does the same thing apply for regular ubot browser as well, although i didnt use wait for element, but i did use regular wait and sometimes it will not type in textbox and sometimes not click: navigate("https://www.bing.com/maps?FORM=Z9LH3","Wait")type text(<id="maps_sb">,"rr","Standard")click(<title="Search">,"Left Click","No") Quote Link to post Share on other sites
Sanjeev 46 Posted September 3, 2018 Report Share Posted September 3, 2018 Does the same thing apply for regular ubot browser as well, although i didnt use wait for element, but i did use regular wait and sometimes it will not type in textbox and sometimes not click: Absolutely! The concept is the same. With normal wait command - if the site takes longer to load than what you have specified - the wait will fail. say, wait 1 sec - then type - but if the element has not loaded yet ,say it will take 1.2 secs to load in this case, then Ubot studio will initiate type text after 1 second. Hence the fail. This is a good practice too - http://network.ubotstudio.com/forum/index.php/topic/19018-solution-wait-for-element-if-not-showing-then-else/ 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.