Results 1 to 6 of 6

Thread: Web scrapping with JAVA based website
Thanks Thanks: 0 Likes Likes: 0

  1. #1
    New Member
    Join Date
    Aug 2019
    Posts
    15
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Web scrapping with JAVA based website

    Hello all,

    current issue is that i am working on one website where it run JAVA script to load data and i need to copy that data once it complete loading. now loading time is not fixed so my code run before it completes loading. do some event and readystate=4 is not working on this.

    is there any way we can delay vba code till java load data?

  2. #2
    Board Regular
    Join Date
    Mar 2019
    Posts
    81
    Post Thanks / Like
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Web scrapping with JAVA based website

    Hi,

    Application.Wait is what i use.

    https://docs.microsoft.com/en-us/off...plication.wait

  3. #3
    New Member
    Join Date
    Aug 2019
    Posts
    15
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Web scrapping with JAVA based website

    Hey,

    thanks buddy but are you sure? i think this is not working when we are working with java because i already tried that.

  4. #4
    Board Regular
    Join Date
    Mar 2019
    Posts
    81
    Post Thanks / Like
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Web scrapping with JAVA based website

    Yes Buddy I am sure.

    here is an example of some code within a sub procedure

    bot.FindElementById("R_T_ENTRY_WEB_ACTIVITY_ID$0").Click
    bot.FindElementById("R_T_ENTRY_WEB_ACTIVITY_ID$prompt$img$0").Click
    bot.SwitchToParentFrame
    bot.SwitchToFrame (3)
    Application.Wait Now + TimeValue("00:00:01")
    bot.FindElementById("RESULT0$9").Click
    bot.SwitchToParentFrame
    bot.SwitchToFrame (0)
    Application.Wait Now + TimeValue("00:00:01")
    Last edited by VBE313; Oct 9th, 2019 at 01:52 PM.

  5. #5
    New Member
    Join Date
    Aug 2019
    Posts
    15
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Web scrapping with JAVA based website

    Hey Awesome..just one query that java takes different time depend on speed of internet to load data. so say if i hold it for 5 secs and java take 10 sec. it will give error. if so then can we hold it dynamically?
    Last edited by Pankil; Oct 11th, 2019 at 08:41 AM.

  6. #6
    Board Regular
    Join Date
    Mar 2019
    Posts
    81
    Post Thanks / Like
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Web scrapping with JAVA based website

    You would have to use WScript.Shell since it has a waitOnReturn option.

    Reference:
    https://stackoverflow.com/questions/...nd-to-complete
    Dim wsh AsObject
    Set wsh = VBA.CreateObject("WScript.Shell")
    Dim waitOnReturn AsBoolean: waitOnReturn =True
    Dim windowStyle AsInteger: windowStyle =1
    wsh.Run"C:\folder\runbat.bat", windowStyle, waitOnReturn




Some videos you may like

User Tag List

Tags for this Thread

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •