none
I need to automatically scroll down all items in a web page drop down box RRS feed

  • Question

  • I am currently using the SendKeys on the web page drop down as below:

    The web page that I am using is: https://greyhoundsform.betfair.com/racingform

    The select id ="meetings"

    wb1.Document.GetElementById("meetings").Focus() 'Get focus on race times SendKeys.Send("^{DOWN}") 'Scroll down
    SendKeys.SendWait("-1") 'Wait until sendkey has completed


    The problem that I have is,while my software project is running (scrolling through the web page drop down list) I am unable to use any other app on my desktop.

    Example:
    When I use Excel or notepad,it will keep entering -1-1-1-1-1 continuously, until I click on my projects form.(returning the focus)
    This is driving me mad,and would love to find a way to scroll through each item in a web page drop down list while using another app at the same time.


    Saturday, November 24, 2018 12:40 PM

Answers

  • Hello Les

    Thank you for your reply.

    I have tried BackgroundWorker,and I keep getting an error when It attempts to focus on the web page drop down list.

    I have never used BackgroundWorker before as I didn't know what it was for.

    Since I received your message,I have been googling it,and cant seem to find what I am looking for.

    I have removed the "SendKeys.SendWait("-1") 'Wait until sendkey has completed"

    and I dont get a series of -1-1-1-1 anymore,but I still get the scrolling effect on Excel,web page or anything else that I open.

    I put the code "wb1.Document.GetElementById("races").Focus() 'To Get focus on race times

    SendKeys.Send("^{DOWN}") , into the BackgroundWorker1_DoWork event.

    This will produce an error as mentioned above.

    I'm not sure if I am doing this correctly.

    Have you any ideas?

    Thanks

    Dan

    • Marked as answer by Programming Dan Wednesday, November 28, 2018 12:15 PM
    Sunday, November 25, 2018 11:04 AM
  • Many thanks Les,I will look into your suggestion.

    Thank you

    Dan

    • Marked as answer by Programming Dan Wednesday, November 28, 2018 12:14 PM
    • Unmarked as answer by Programming Dan Wednesday, November 28, 2018 12:14 PM
    • Marked as answer by Programming Dan Wednesday, November 28, 2018 12:14 PM
    Monday, November 26, 2018 12:51 PM
  • Hello

    Thanks for your reply,and suggestion that this could be deemed as a, no go area.

    I will look at the T&C's,and if I am not allowed to do this,then I will have to abandon my project.

    Thank you for the heads up

    Dan

    • Marked as answer by Programming Dan Wednesday, November 28, 2018 12:14 PM
    Monday, November 26, 2018 12:53 PM
  • Hello IronRazerz

    I have been looking around and to my knowledge,it is allowed,as I am only scraping the form guide.

    Been trying all sorts today,but with no joy

    Dan

    • Marked as answer by Programming Dan Wednesday, November 28, 2018 12:13 PM
    Monday, November 26, 2018 8:50 PM

All replies

  • Hi

    (Untested) Maybe try using a BackGroundWorker?


    Regards Les, Livingston, Scotland

    Saturday, November 24, 2018 1:36 PM
  • Hello Les

    Thank you for your reply.

    I have tried BackgroundWorker,and I keep getting an error when It attempts to focus on the web page drop down list.

    I have never used BackgroundWorker before as I didn't know what it was for.

    Since I received your message,I have been googling it,and cant seem to find what I am looking for.

    I have removed the "SendKeys.SendWait("-1") 'Wait until sendkey has completed"

    and I dont get a series of -1-1-1-1 anymore,but I still get the scrolling effect on Excel,web page or anything else that I open.

    I put the code "wb1.Document.GetElementById("races").Focus() 'To Get focus on race times

    SendKeys.Send("^{DOWN}") , into the BackgroundWorker1_DoWork event.

    This will produce an error as mentioned above.

    I'm not sure if I am doing this correctly.

    Have you any ideas?

    Thanks

    Dan

    • Marked as answer by Programming Dan Wednesday, November 28, 2018 12:15 PM
    Sunday, November 25, 2018 11:04 AM
  • Hi

    Using a BackGroundWorker requires cross-thread care. You may need to use delegates to interact with other threads.

    Sorry I can't be more specific.


    Regards Les, Livingston, Scotland

    Sunday, November 25, 2018 12:36 PM
  •  If the page you gave us an address to is owned by betfair,  which I am guessing it is,  you can almost be sure that they require you to use their program developer API's to access the data and/or place bets on there sites.  If you have not done so,  you should read their Terms Of Service (TOS) or Terms Of Use (TOU),  and if it is still not clear,  then contact them to see if they allow automation and data scraping from their site like you are doing.

     If they don't allow it without using their API's and you get caught automating and scraping data,  you could face stiff legal penalties and/or be banned from their site.  8)


    If you say it can`t be done then i`ll try it

    Sunday, November 25, 2018 6:48 PM
  • Many thanks Les,I will look into your suggestion.

    Thank you

    Dan

    • Marked as answer by Programming Dan Wednesday, November 28, 2018 12:14 PM
    • Unmarked as answer by Programming Dan Wednesday, November 28, 2018 12:14 PM
    • Marked as answer by Programming Dan Wednesday, November 28, 2018 12:14 PM
    Monday, November 26, 2018 12:51 PM
  • Hello

    Thanks for your reply,and suggestion that this could be deemed as a, no go area.

    I will look at the T&C's,and if I am not allowed to do this,then I will have to abandon my project.

    Thank you for the heads up

    Dan

    • Marked as answer by Programming Dan Wednesday, November 28, 2018 12:14 PM
    Monday, November 26, 2018 12:53 PM
  • Hello IronRazerz

    I have been looking around and to my knowledge,it is allowed,as I am only scraping the form guide.

    Been trying all sorts today,but with no joy

    Dan

    • Marked as answer by Programming Dan Wednesday, November 28, 2018 12:13 PM
    Monday, November 26, 2018 8:50 PM