Results 1 to 12 of 12

Thread: A problem with Web Elements

  1. #1

    Thread Starter
    Addicted Member erenagar's Avatar
    Join Date
    Jul 2014
    Posts
    153

    A problem with Web Elements

    Hello guys, I have a login page in my website. I'm developing a login program.

    Code:
    For Each obj In WebBrowser1.Document.GetElementsByTagName("input")
                If (obj.GetAttribute("name") = "email") Then
                    obj.Value = Text1.Text
                End If
                Next
    I'm writing my textbox(username) to login website e-mail area and..

    Code:
    For Each obj In WebBrowser1.Document.GetElementsByTagName("button")
                If (obj.GetAttribute("submit") = "login") Then
                    obj.click
                End If
                Next
    I'm sending login request. There is not a problem my textbox appear to web but when I click submit button textbox like dissapear like as no writen as..

    Attachment 137125Attachment 137127

    So I can't log in. How can I transfer correctly?

    ***There is html of login text;

    Code:
    <input class="abc" aria-describedby="" aria-label="E-mail" aria-required="true" autocapitalize="off" autocorrect="off" name="email" placeholder="E-mail" value="" type="text" data-reactid=".0.1.0.1.0.1.0.3.0">
    Last edited by erenagar; Apr 16th, 2016 at 09:37 AM.

  2. #2
    PowerPoster
    Join Date
    Jan 2008
    Posts
    11,074

    Re: A problem with Web Elements

    "submit" is not a Tag name nor is it an attribute

    Code:
     For Each obj In WebBrowser1.Document.GetElementsByTagName("submit")
       If (obj.GetAttribute("submit") = "login") Then
         obj.click
         Exit For 
      End If
     Next
    Last edited by jmsrickland; Apr 16th, 2016 at 09:41 AM.


    Anything I post is an example only and is not intended to be the only solution, the total solution nor the final solution to your request nor do I claim that it is. If you find it useful then it is entirely up to you to make whatever changes necessary you feel are adequate for your purposes.

  3. #3

    Thread Starter
    Addicted Member erenagar's Avatar
    Join Date
    Jul 2014
    Posts
    153

    Re: A problem with Web Elements

    Quote Originally Posted by jmsrickland View Post
    "submit" is not a Tag name
    It is an example.. There is a problem it is not tags names...
    *It is <button>

  4. #4

    Thread Starter
    Addicted Member erenagar's Avatar
    Join Date
    Jul 2014
    Posts
    153

    Re: A problem with Web Elements

    Quote Originally Posted by jmsrickland View Post
    "submit" is not a Tag name nor is it an attribute

    Code:
     For Each obj In WebBrowser1.Document.GetElementsByTagName("submit")
       If (obj.GetAttribute("submit") = "login") Then
         obj.click
         Exit For 
      End If
     Next
    Man it is not problem to clicking login button. I could do it. My problem is when i click login button my text datas disappear and login page will show error "Please fill blanks"

  5. #5
    PowerPoster
    Join Date
    Jan 2008
    Posts
    11,074

    Re: A problem with Web Elements

    In your 1st post you said your textbox disappears and now you are saying your data disappears. So when you say data you mean you username disappears from the the input textbox when you click on login button.


    Anything I post is an example only and is not intended to be the only solution, the total solution nor the final solution to your request nor do I claim that it is. If you find it useful then it is entirely up to you to make whatever changes necessary you feel are adequate for your purposes.

  6. #6

    Thread Starter
    Addicted Member erenagar's Avatar
    Join Date
    Jul 2014
    Posts
    153

    Re: A problem with Web Elements

    Quote Originally Posted by jmsrickland View Post
    In your 1st post you said your textbox disappears and now you are saying your data disappears. So when you say data you mean you username disappears from the the input textbox when you click on login button.
    Yes yes when i click login button my written username data deleting and error occuring "Fill blanks..."

  7. #7
    PowerPoster
    Join Date
    Jan 2008
    Posts
    11,074

    Re: A problem with Web Elements

    Many web sites will erase your input data if it is incorrect when you submit the web form or you do something that is not the proper thing to do. I can't tell what your data is and if it is correct; I'm assuming its your email address since you are looking for an input box that has the name "emal". So, if it is your email address and it is correct then the only other thing I can guess at is you are not submitting the correct button but you already said you have no problem clicking on submit button even though I think your code is wrong.

    Can you post the HTML that shows the two elements you are coding for
    Last edited by jmsrickland; Apr 16th, 2016 at 11:01 AM.


    Anything I post is an example only and is not intended to be the only solution, the total solution nor the final solution to your request nor do I claim that it is. If you find it useful then it is entirely up to you to make whatever changes necessary you feel are adequate for your purposes.

  8. #8

    Thread Starter
    Addicted Member erenagar's Avatar
    Join Date
    Jul 2014
    Posts
    153

    Re: A problem with Web Elements

    Quote Originally Posted by jmsrickland View Post
    Many web sites will erase your input data if it is incorrect when you submit the web form or you do something that is not the proper thing to do. I can't tell what your data is and if it is correct; I'm assuming its your email address since you are looking for an input box that has the name "emal". So, if it is your email address and it is correct then the only other thing I can guess at is you are not submitting the correct button but you already said you have no problem clicking on submit button even though I think your code is wrong.

    Can you post the HTML that shows the two elements you are coding for
    Now I'm looking for register,

    E-mail HTML;
    Code:
    <input class="_kp5f7 _qy55y" aria-describedby="" aria-label="E-posta" aria-required="true" autocapitalize="off" autocorrect="off" name="email" placeholder="E-posta" value="" type="text" data-reactid=".0.1.0.1.0.1.0.3.0">
    E-mail VB;
    Code:
    For Each obj In WebBrowser1.Document.GetElementsByTagName("input")
                If (obj.GetAttribute("name") = "email") Then
                    obj.Value = List3.Text
                End If
                Next
    Name HTML;
    Code:
    <input class="_kp5f7 _qy55y" aria-describedby="" aria-label="Tam Adın" aria-required="false" autocapitalize="sentences" autocorrect="off" name="fullName" placeholder="Tam Adın" value="" type="text" data-reactid=".0.1.0.1.0.1.0.4.0">
    Name VB;
    Code:
    For Each obj2 In WebBrowser1.Document.GetElementsByTagName("input")
                If (obj2.GetAttribute("name") = "fullName") Then
                    obj2.Value = List1.Text & " " & List2.Text
                End If
                Next
    Username HTML;
    Code:
    <input class="_kp5f7 _qy55y" aria-describedby="" aria-label="Kullanıcı adı" aria-required="true" autocapitalize="off" autocorrect="off" maxlength="30" name="username" placeholder="Kullanıcı adı" value="" type="text" data-reactid=".0.1.0.1.0.1.0.5.0">
    Username VB;
    Code:
    For Each obj3 In WebBrowser1.Document.GetElementsByTagName("input")
                If (obj3.GetAttribute("name") = "username") Then
                    obj3.Value = List4.Text
                End If
                Next
    Password HTML;
    Code:
    <input class="_kp5f7 _qy55y" aria-describedby="" aria-label="Şifre" aria-required="true" autocapitalize="off" autocorrect="off" name="password" placeholder="Şifre" type="password" value="" data-reactid=".0.1.0.1.0.1.0.6.0">
    Password VB;
    Code:
    For Each obj4 In WebBrowser1.Document.GetElementsByTagName("input")
                If (obj4.GetAttribute("name") = "password") Then
                    obj4.Value = Text1.Text
                End If
                Next
    And this is register button in HTML;
    Code:
    <button class="_1on88 _k2yal _84y62 _7xso1 _nv5lf" data-reactid=".0.1.0.1.0.1.0.7.0">Kaydol</button>
    Register button VB;
    Code:
    For Each obj5 In WebBrowser1.Document.GetElementsByTagName("button")
                If (obj5.GetAttribute("data-reactid") = ".0.1.0.1.0.1.0.7.0") Then
                    obj5.Click
                End If
                Next
    I have 4 textbox and 1 button when I'm trying to textbox > web text area this error occuring. "Fill blanks..." because It seems to have transferred but actually not transfered just appeared...
    Last edited by erenagar; Apr 16th, 2016 at 12:55 PM.

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

    Re: A problem with Web Elements

    can you post a link to the page?
    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

  10. #10
    PowerPoster
    Join Date
    Jan 2008
    Posts
    11,074

    Re: A problem with Web Elements

    Well your code fills in the fields and clicks the button so I suspect there is something else going on in your code you are not exposing or you are not sending the correct data and the web site is rejecting your submit and making you do it again which is quite common with web sites. So, without seeing all of your code and/or being able to access the web site with the correct data there isn't anything else I can do for you


    Anything I post is an example only and is not intended to be the only solution, the total solution nor the final solution to your request nor do I claim that it is. If you find it useful then it is entirely up to you to make whatever changes necessary you feel are adequate for your purposes.

  11. #11
    Fanatic Member
    Join Date
    Apr 2015
    Location
    Finland
    Posts
    679

    Re: A problem with Web Elements

    Quote Originally Posted by eren2340 View Post
    Hello guys, I have a login page in my website. I'm developing a login program.

    I'm sending login request.
    Code:
    <input class="_kp5f7 _qy55y" aria-describedby=""
    aand... how nice that in 'your webiste' has exactly same class than some other well known website has...

    Few others 'magically' has same kind of problem, but in decoding malware.
    http://ddecode.com/phpdecoder/?resul...1fe46560c18de7

    I think that we should not help you, with that brute forcing code.

  12. #12

    Re: A problem with Web Elements

    We're using IIS as our main webserver, but I know we had to install something Tomcat-related at install time, plus I guess the CMC runs under Tomcat (thus the 8080 port number). I'll try going back to do the HTML pass-through according to the Tomcat instructions (previously I just did the IIS instructions).

Tags for this Thread

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