Frank 177 Posted November 7, 2012 Report Share Posted November 7, 2012 I've coded a ton of bots but I just ran into a simple problem and I'm not sure how to do this. I need to have the ability to have the browser window to focus in on and display an element on the page. So, if the element is sitting below the fold, out of sight, I'd like a command that will bring it to the top of the page. There is a focus command but it doesn't do this. Any thoughts? Frank Quote Link to post Share on other sites
Pete 121 Posted November 7, 2012 Report Share Posted November 7, 2012 Untested first thoughts Can you not just change the element and add an anchor so you can just click and scroll to it? Quote Link to post Share on other sites
k1lv9h 76 Posted November 7, 2012 Report Share Posted November 7, 2012 Hi, Javascript maybe:run javascript("var element = document.getElementById(\"support\") element.scrollIntoView(true)") Sample code will scroll "Screen resolution" to top of browser window. Sample code using getElementById:navigate("http://www.infobyip.com/", "Wait") run javascript("var element = document.getElementById(\"screen_dimensions\") element.scrollIntoView(true)") Sample code using getElementByTagName:navigate("http://www.infobyip.com/", "Wait") run javascript("var element = document.getElementsByTagName(\"td\")[42] element.scrollIntoView(true)") Kevin Quote Link to post Share on other sites
UBotBuddy 331 Posted November 7, 2012 Report Share Posted November 7, 2012 Frank use the Focus node and then use the camera selector to select your object. My bots ALWAYS scrolls down to that object. Buddy 2 Quote Link to post Share on other sites
Frank 177 Posted November 8, 2012 Author Report Share Posted November 8, 2012 Smart Buddy. I like it. Hey Buddy, I tried your idea with poor results. Could you cut a bit of code on a sample page as a demo? Thanks! Frank Quote Link to post Share on other sites
VaultBoss 310 Posted November 8, 2012 Report Share Posted November 8, 2012 Frank use the Focus node and then use the camera selector to select your object. My bots ALWAYS scrolls down to that object. Buddy Smart!+1 Quote Link to post Share on other sites
UBotBuddy 331 Posted November 8, 2012 Report Share Posted November 8, 2012 THIS IS CRAZY! I have three bots now that are now broken. This trick is now failing. One of my bots is a Pinterest bot so scrolling down automatically is essential. My test site which was eBay changed to a Pinterest look from yesterday so that bot no longer works either. UGHHHH! Quote Link to post Share on other sites
UBotBuddy 331 Posted November 8, 2012 Report Share Posted November 8, 2012 I just tried my ebay bot again and it worked. Go figure as to why it is hot & cold. Here it is Test-Focus.ubot Buddy Quote Link to post Share on other sites
Frank 177 Posted November 8, 2012 Author Report Share Posted November 8, 2012 Thanks a ton Buddy, but still no dice. Frank Quote Link to post Share on other sites
UBotBuddy 331 Posted November 8, 2012 Report Share Posted November 8, 2012 It seems to work and then not work. VERY strange. I am also working on a way to use the $exist function. It actually blinks the screen so I have a small hunch that might be a tiny bit of hope for another possible workaround. 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.