Results 1 to 24 of 24

Thread: LOG INTO WEBSITE "www.way2sms.com"

  1. #1

    Thread Starter
    New Member
    Join Date
    Apr 2010
    Posts
    12

    LOG INTO WEBSITE "www.way2sms.com"

    Hello everyone

    I need to write a code that opens up internet explorer to www.way2sms.com, logs in with my userid and password, navigates to the "Quick Sms" page, enters text in the field and sends the sms.

    Need urgent help.. please

  2. #2
    Next Of Kin baja_yu's Avatar
    Join Date
    Aug 2002
    Location
    /dev/root
    Posts
    5,989

    Re: LOG INTO WEBSITE "www.way2sms.com"

    Search (http://www.vbforums.com/search.php) for "website login" or "website fill form", there are a lot of examples. This is one of them http://www.vbforums.com/showthread.p...=website+login

  3. #3
    PowerPoster
    Join Date
    Dec 2004
    Posts
    25,618

    Re: LOG INTO WEBSITE "www.way2sms.com"

    this is quite a simple one
    vb Code:
    1. Set wb = CreateObject("internetexplorer.application")
    2. wb.navigate2 "http://wwwf.way2sms.com/content/index.html"
    3. wb.Visible = True
    4. Do Until wb.readystate = 4
    5.     DoEvents
    6. Loop
    7. Set f = wb.document.Forms(0)
    8. f.All("password").Value = "pass"
    9. f.All("username").Value = "789894588"
    10. f.submit
    i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
    Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next

    dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part

    come back and mark your original post as resolved if your problem is fixed
    pete

  4. #4
    Discovering Life Siddharth Rout's Avatar
    Join Date
    Feb 2005
    Location
    Mumbai, India
    Posts
    12,001

    Re: LOG INTO WEBSITE "www.way2sms.com"

    A good exercise for the Heart is to bend down and help another up...
    Please Mark your Thread "Resolved", if the query is solved


    MyGear:
    ★ CPU ★ Ryzen 5 5800X
    ★ GPU ★ NVIDIA GeForce RTX 3080 TI Founder Edition
    ★ RAM ★ G. Skill Trident Z RGB 32GB 3600MHz
    ★ MB ★ ASUS TUF GAMING X570 (WI-FI) ATX Gaming
    ★ Storage ★ SSD SB-ROCKET-1TB + SEAGATE 2TB Barracuda IHD
    ★ Cooling ★ NOCTUA NH-D15 CHROMAX BLACK 140mm + 10 of Noctua NF-F12 PWM
    ★ PSU ★ ANTEC HCG-1000-EXTREME 1000 Watt 80 Plus Gold Fully Modular PSU
    ★ Case ★ LIAN LI PC-O11 DYNAMIC XL ROG (BLACK) (G99.O11DXL-X)
    ★ Monitor ★ LG Ultragear 27" 240Hz Gaming Monitor
    ★ Keyboard ★ TVS Electronics Gold Keyboard
    ★ Mouse ★ Logitech G502 Hero

  5. #5

    Thread Starter
    New Member
    Join Date
    Apr 2010
    Posts
    12

    Re: LOG INTO WEBSITE "www.way2sms.com"

    Quote Originally Posted by westconn1 View Post
    this is quite a simple one
    vb Code:
    1. Set wb = CreateObject("internetexplorer.application")
    2. wb.navigate2 "http://wwwf.way2sms.com/content/index.html"
    3. wb.Visible = True
    4. Do Until wb.readystate = 4
    5.     DoEvents
    6. Loop
    7. Set f = wb.document.Forms(0)
    8. f.All("password").Value = "pass"
    9. f.All("username").Value = "789894588"
    10. f.submit
    thanks so much!

    i have successfully logged into the site.

    now i just need to "click" on the "quicksms" tab, type the phonenumber to send it to and type the message. click on "send"

    and close internet explorer.

    can u please help me?? thanks again

  6. #6
    PowerPoster dilettante's Avatar
    Join Date
    Feb 2006
    Posts
    24,487

    Re: LOG INTO WEBSITE "www.way2sms.com"

    Like most advertising supported Web pages, webscraping to get access to its services may be against the provider's Terms and Conditions. The site's T&Cs document mentions a number of requirements your program may be violating.

    I thought this sort of topic was prohibited in these forums, but a moderator might clarify that.

  7. #7
    PowerPoster
    Join Date
    Dec 2004
    Posts
    25,618

    Re: LOG INTO WEBSITE "www.way2sms.com"

    as i am not a member of that site and can not login, i am unable to see any of the pages after the login page

    and close internet explorer.
    vb Code:
    1. wb.quit
    2. set wb = nothing
    i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
    Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next

    dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part

    come back and mark your original post as resolved if your problem is fixed
    pete

  8. #8

    Thread Starter
    New Member
    Join Date
    Apr 2010
    Posts
    12

    Re: LOG INTO WEBSITE "www.way2sms.com"

    msconn.

    userid is 9998461800
    password is puri332434

    my code is

    Private Sub Command1_Click()
    WebBrowser1.Navigate "http://wwwe.way2sms.com/content/index.html"
    Do Until WebBrowser1.ReadyState = 4
    DoEvents
    Loop

    WebBrowser1.Document.loginForm.username.Value = "9998461800"
    WebBrowser1.Document.loginForm.password.Value = "puri332434"
    Do Until WebBrowser1.ReadyState = 4
    DoEvents
    Loop

    WebBrowser1.Document.loginForm.submit
    Do Until WebBrowser1.ReadyState = 4
    DoEvents
    Loop
    End Sub


    Private Sub Command2_Click()
    WebBrowser1.Document.All.wayquicksms1.Click

    Do Until WebBrowser1.ReadyState = 4
    DoEvents
    Loop
    End Sub

    Private Sub Command3_Click()
    WebBrowser1.Document.rtform.MobNo.Value = "9998461800"
    WebBrowser1.Document.rtform.TextArea.Value = "hi"
    Do Until WebBrowser1.ReadyState = 4
    DoEvents
    Loop
    WebBrowser1.Document.All.send.Click
    End Sub

    now i can click on the "quicksms" tab

    but cant enter text in the form that loads

    i cant find the name of the form that loads

    please help

  9. #9

    Thread Starter
    New Member
    Join Date
    Apr 2010
    Posts
    12

    Re: LOG INTO WEBSITE "www.way2sms.com"

    i even tried sendkeys after the "quicksms" tab has been pressed

    but the quicksms opens up a "frame" rather than a form..

    can that be the problem.. if so.. how do i tackle it?

  10. #10
    PowerPoster
    Join Date
    Dec 2004
    Posts
    25,618

    Re: LOG INTO WEBSITE "www.way2sms.com"

    there are several examples on using frames within a webbrowser (or IE) in this forum, note iframes are a bit different to webpage frames, but both types are includes in the frames collection
    i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
    Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next

    dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part

    come back and mark your original post as resolved if your problem is fixed
    pete

  11. #11

    Thread Starter
    New Member
    Join Date
    Apr 2010
    Posts
    12

    Re: LOG INTO WEBSITE "www.way2sms.com"

    THANKS WESTCONN.. IT WORKED!
    NOW JUST ONE FINAL STEP TO GO..
    heres the problem..
    my code is

    Private Sub Form_Load()
    WebBrowser1.Navigate "http://wwwe.way2sms.com//content/index.html"
    Do Until WebBrowser1.ReadyState = 4
    DoEvents
    Loop
    WebBrowser1.Document.All.username.Value = "9998461800"
    WebBrowser1.Document.All.password.Value = "puri332434"
    WebBrowser1.Document.loginForm.submit
    Do Until WebBrowser1.ReadyState = 4
    DoEvents
    Loop
    End Sub

    'now i need to wait so that the login is done and the next page is loaded
    Private Sub Command1_Click()
    WebBrowser1.Document.All.wayquicksms1.Click
    End Sub

    'wait for the frame to load, then type and send sms
    Private Sub Command2_Click()
    WebBrowser1.Document.frames("frame").Document.All("MobNo").Value = "9998461800"
    WebBrowser1.Document.frames("frame").Document.All("textArea").Value = "Hello"
    Do Until WebBrowser1.ReadyState = 4
    DoEvents
    Loop
    WebBrowser1.Document.frames("frame").Document.All("Send").Click
    End Sub


    AS YOU CAN SEE, I NEED TO WRITE A CODE BETWEEN THE BUTTON CLICKS WHICH ALLOW ME TO WAIT UNTIL THE NEXT FORM OR FRAME IS LOADED, THEN PERFORM THE NEXT TASK..

    i tried this
    DO UNTIL WEBBROWSER1.READYSTATE = 4
    DO EVENTS
    LOOP

    but still keeps giving me errors

    CAN U WRITE A CODE FOR ME TO WAIT SAY 2 TO 3 SECONS?
    THANK YOU

    ALMOST RESOLVED

  12. #12
    Freelancer akhileshbc's Avatar
    Join Date
    Jun 2008
    Location
    Trivandrum, Kerala, India
    Posts
    7,652

    Re: LOG INTO WEBSITE "www.way2sms.com"

    I think you can use the Sleep API if you want.

    Example:
    Code:
    Option Explicit
    
    Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
    
    Private Sub Command1_Click()
      MsgBox "Going to sleep for 2 seconds. Are you ready ?"
      Sleep 2000
      MsgBox "Ok. I am back"
    End Sub
    ...

    If my post was helpful to you, then express your gratitude using Rate this Post.
    And if your problem is SOLVED, then please Mark the Thread as RESOLVED (see it in action - video)
    My system: AMD FX 6100, Gigabyte Motherboard, 8 GB Crossair Vengance, Cooler Master 450W Thunder PSU, 1.4 TB HDD, 18.5" TFT(Wide), Antec V1 Cabinet

    Social Group: VBForums - Developers from India


    Skills: PHP, MySQL, jQuery, VB.Net, Photoshop, CodeIgniter, Bootstrap,...

  13. #13
    PowerPoster
    Join Date
    Dec 2004
    Posts
    25,618

    Re: LOG INTO WEBSITE "www.way2sms.com"

    you can try like this to wait for the frame to load
    vb Code:
    1. wb.document.All.wayquicksms1.Click
    2. Set f = wb.document.frames(0)
    3. Do Until f.document.readystate = "complete"
    4. DoEvents
    5. Loop
    i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
    Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next

    dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part

    come back and mark your original post as resolved if your problem is fixed
    pete

  14. #14

    Thread Starter
    New Member
    Join Date
    Apr 2010
    Posts
    12

    Re: LOG INTO WEBSITE "www.way2sms.com"

    it says "variable not defined and points to f"

  15. #15
    Next Of Kin baja_yu's Avatar
    Join Date
    Aug 2002
    Location
    /dev/root
    Posts
    5,989

    Re: LOG INTO WEBSITE "www.way2sms.com"

    So define it. I think it should be Dim f As HTMLDocument

  16. #16

    Thread Starter
    New Member
    Join Date
    Apr 2010
    Posts
    12

    Re: LOG INTO WEBSITE "www.way2sms.com"

    i also tried this

    Private Sub Command1_Click()
    WebBrowser1.Document.All.wayquicksms1.Click
    Do Until WebBrowser1.Document.frames("frame").Document.ReadyState = "complete"
    DoEvents
    Loop
    WebBrowser1.Document.frames("frame").Document.All("MobNo").Value = "9998461800"
    WebBrowser1.Document.frames("frame").Document.All("textArea").Value = "Hello"

    End Sub

    but it says "object vaiable or with block variable not set"

  17. #17

    Thread Starter
    New Member
    Join Date
    Apr 2010
    Posts
    12

    Re: LOG INTO WEBSITE "www.way2sms.com"

    Quote Originally Posted by baja_yu View Post
    So define it. I think it should be Dim f As HTMLDocument
    tried

    giving me error 91

    "object variable or with block variable not set"

  18. #18
    Next Of Kin baja_yu's Avatar
    Join Date
    Aug 2002
    Location
    /dev/root
    Posts
    5,989

    Re: LOG INTO WEBSITE "www.way2sms.com"

    At what line of code? You'll have to be more precise.

  19. #19

    Thread Starter
    New Member
    Join Date
    Apr 2010
    Posts
    12

    Re: LOG INTO WEBSITE "www.way2sms.com"

    Code:
    Private Sub Command1_Click()
    Dim f As HTMLDocument
    'WebBrowser1.Document.All.wayquicksms1.Click
    WebBrowser1.Document.All.wayquicksms1.Click
    Set f = WebBrowser1.Document.frames(0)
    Do Until f.Document.ReadyState = "complete"
    DoEvents
    Loop
    WebBrowser1.Document.frames("frame").Document.All("MobNo").Value = "9998461800"
    WebBrowser1.Document.frames("frame").Document.All("textArea").Value = "Hello"
    End Sub
    thats where i'm getting the erroe.
    according to the code, it shud click on "quicksms" which it does..
    but it should also wait till the frame loads, and write in the texts.. but it gives me the error :-(

  20. #20
    PowerPoster
    Join Date
    Dec 2004
    Posts
    25,618

    Re: LOG INTO WEBSITE "www.way2sms.com"

    are you sure the frame has a name (frame) ?
    try
    f.Document.All("MobNo").Value = "9998461800"
    as f is already an object of the frame element

    as far as i can tell f should be an htmwindow2, i use object
    Last edited by westconn1; Apr 2nd, 2010 at 03:48 PM.
    i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
    Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next

    dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part

    come back and mark your original post as resolved if your problem is fixed
    pete

  21. #21

    Thread Starter
    New Member
    Join Date
    Apr 2010
    Posts
    12

    Re: LOG INTO WEBSITE "www.way2sms.com"

    Code:
    Private Sub Command1_Click()
    Dim f As Object
    WebBrowser1.Document.All.wayquicksms1.Click
    Set f = WebBrowser1.Document.frames(0)
    Do Until f.Document.ReadyState = "complete"
    DoEvents
    Loop
    f.Document.All("MobNo").Value = "9998461800"
    f.Document.All("textArea").Value = "Hello"
    End Sub
    tried :-(

    but still the same error.
    object variable or with block variable not set.

    god!! i just need the entire process to happen in 1 event instead of 3
    why is that too much to ask :-(

    i also tried
    dim f as htmlwindow2

    no luck

  22. #22
    PowerPoster
    Join Date
    Dec 2004
    Posts
    25,618

    Re: LOG INTO WEBSITE "www.way2sms.com"

    vb Code:
    1. wb.navigate2 "http://wwwf.way2sms.com/content/index.html"
    2. wb.Visible = True
    3. Do Until wb.readystate = 4
    4.     DoEvents
    5. Loop
    6. Set f = wb.document.Forms(0)
    7. f.All("password").Value = "puri332434"
    8. f.All("username").Value = "9998461800"
    9. f.submit
    10. Do Until wb.readystate = 4 And Not wb.busy
    11. DoEvents
    12. Loop
    13. 'Do While wb.busy
    14. 'DoEvents
    15. 'Loop
    16. wb.document.All.wayquicksms1.Click
    17. Set f = wb.document.frames(0)
    18. Do Until f.document.readystate = "complete" 'And Not wb.busy
    19. DoEvents
    20. Loop
    21. f.document.All("MobNo").Value = "9998461800"
    22. f.document.All("textArea").Value = "Hello"
    23. f.document.All("Send").Click
    this almost works for me, problem with pop-upblocker dialog has to be dismissed manually, message was sent
    i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
    Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next

    dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part

    come back and mark your original post as resolved if your problem is fixed
    pete

  23. #23

    Thread Starter
    New Member
    Join Date
    Apr 2010
    Posts
    12

    Re: LOG INTO WEBSITE "www.way2sms.com"

    Code:
    wb.navigate2 "http://wwwf.way2sms.com/content/index.html"
    wb.Visible = True
    Do Until wb.readystate = 4
        DoEvents
    Loop
    Set f = wb.document.Forms(0)
    f.All("password").Value = "puri332434"
    f.All("username").Value = "9998461800"
    f.submit
    Do Until wb.readystate = 4 And Not wb.busy
    DoEvents
    Loop
    'Do While wb.busy
    'DoEvents
    'Loop
    wb.document.All.wayquicksms1.Click
    Set f = wb.document.frames(0)
    Do Until f.document.readystate = "complete" 'And Not wb.busy
    DoEvents
    Loop
    f.document.All("MobNo").Value = "9998461800"
    f.document.All("textArea").Value = "Hello"
    f.document.All("Send").Click
    it says "object doesn't support this property or method"
    how come it works for u??

  24. #24
    Hyperactive Member
    Join Date
    Jun 2007
    Posts
    280

    Re: LOG INTO WEBSITE "www.way2sms.com"

    Imbakaran, please tell me that in post #8 you did not put your real UserID and Password on a public forum. If you did your account is anybodies on the internet until you change your password. Forums such as this and many others are meant to be found by search engines. That is why you should never put any personal information on one.
    Slower than a crippled Vista
    More buggy than a fresh XP install
    Look! Down the road, some 50 miles behind the drunken snail.
    It's Ubuntu!

Posting Permissions

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



Click Here to Expand Forum to Full Width