locked
webbrowser autoscroll down

    Question

  • Hello Great programmers, pls i am looking for a solution to a problem which i know is easy for you guys....

    I am trying to make a software that will navigate to google image , extract all the image source and still yet scroll down and continue to extract all the image source... just like a "Do" command.

    But my problem is that, i don't know how to autoscroll the webbrowser down.

    IF you don't get what i am saying....... for instance, you go to google image and search for something... it will return your search for you but not all until you scroll down. it is when you scroll down that more results will be loaded. so that is exactly what i am saying.

    I have search the net but couldn't seem to find what i am looking for.

    i am currently using this code below:

    "   WebBrowser1.Document.Window.ScrollTo("0", "9800") "

    The code loads then it reaches a point it stops.

    I want it to stop only when the page has finished loading all the searched images.

    By the way, i use VB(visual basic) to code.

    Thanks for your understanding and hoping to see a  result soon great programmers.
    Saturday, August 16, 2014 8:27 AM

Answers

  • Hi Henry,

    There is no way to interact with the scrolling of the page in webbrowser control. But we can use scrollBy javascript method to work around this problem. When the webbrowser control completes loading the content, use the following code.

    webBrowser1.InvokeScript("eval", "window.scrollBy(100,100);");

    You can use Timer to make this automatic.

    Regards,


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Monday, August 18, 2014 8:55 AM
    Moderator