Jump to content
UBot Underground

Bing Maps Issue Navigating And Clicking Xpath


Recommended Posts

I tried several times but somehow can't get the correct xpath to work fo navigating and entering variables using xpath xbrowser in bing maps


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 Type Text (Human Delay)", "//*[@id=\"maps_sb\"]", "{#Niche} {#Country}", "", "")
plugin command("ExBrowser.dll", "ExBrowser Click", "//*[@id=\"maps_sb_container\"]/div[1]/div")
 

Link to post
Share on other sites

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")

Link to post
Share on other sites

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!  :)

Link to post
Share on other sites

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")

Link to post
Share on other sites

 

 

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/

 

 

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...