dcsimg
Results 1 to 6 of 6
  1. #1

    Thread Starter
    Member
    Join Date
    Oct 2015
    Posts
    49

    Clicking List Item with webbrowser

    Hello, I am trying to click a list item and can't seem to get it to work, any help is appreciated.

    HTML:

    HTML Code:
    <div data-auto-id="item-wrapper" class="options___3vh9m options-squared___1ta3r">
    <ul class="square_list___2W6oQ square_list___33sO- ">
    <li class="" title="3.5">3.5</li>
    <li class="" title="4">4</li>
    <li class="" title="4.5">4.5</li>
    <li class="" title="5">5</li>
    <li class="" title="5.5">5.5</li>
    <li class="" title="6">6</li>
    <li class="" title="6.5">6.5</li>
    <li class="" title="7">7</li>
    <li class="" title="7.5">7.5</li>
    <li class="" title="8">8</li>
    <li class="" title="8.5">8.5</li>
    <li class="" title="9">9</li>
    <li class="" title="9.5">9.5</li>
    <li class="" title="10">10</li>
    <li class="" title="10.5">10.5</li>
    <li class="" title="11">11</li>
    <li class="" title="11.5">11.5</li>
    <li class="" title="12">12</li>
    <li class="" title="12.5">12.5</li>
    <li class="" title="13">13</li>
    <li class="" title="13.5">13.5</li>
    </ul>
    <div class="sold_out_content_wrapper___1hZZK">
    </div>
    </div>
    VB.NET:
    Code:
    For Each pageBtn In WebBrowser1.Document.GetElementsByTagName("li")
                    If pageBtn.InnerHtml = "4.5" Then
                        pageBtn.InvokeMember("click")
                    End If
                Next
    The LI never seems to get clicked.

    Thanks.

  2. #2
    eXtreme Programmer .paul.'s Avatar
    Join Date
    May 2007
    Location
    Chelmsford UK
    Posts
    21,674

    Re: Clicking List Item with webbrowser

    LI is not a clickable element. You can put a link inside the list item though...

    <li class="" title="3.5"><a href="#">3.5</a></li>

    The link is clickable...

  3. #3

    Thread Starter
    Member
    Join Date
    Oct 2015
    Posts
    49

    Re: Clicking List Item with webbrowser

    Quote Originally Posted by .paul. View Post
    LI is not a clickable element. You can put a link inside the list item though...

    <li class="" title="3.5"><a href="#">3.5</a></li>

    The link is clickable...
    I do not have access to the source as I am trying to interact with elements on someone else's site, so how would I be able to click on one of those options?

  4. #4
    eXtreme Programmer .paul.'s Avatar
    Join Date
    May 2007
    Location
    Chelmsford UK
    Posts
    21,674

    Re: Clicking List Item with webbrowser

    Can you show me the page?

  5. #5

    Thread Starter
    Member
    Join Date
    Oct 2015
    Posts
    49

    Re: Clicking List Item with webbrowser

    Quote Originally Posted by .paul. View Post
    Can you show me the page?
    Wasn't sure if my PMs sent.

    Code:
    <select class="select___2OzfB">
    <option value="defaultOption" disabled="" hidden=""></option>
    <option value="0">3.5</option>
    <option value="1">4</option>
    <option value="2">4.5</option>
    <option value="3">5</option>
    <option value="4">5.5</option>
    <option value="5">6</option>
    <option value="6">6.5</option>
    <option value="7">7</option>
    <option value="8">7.5</option>
    <option value="9">8</option>
    <option value="10">8.5</option>
    <option value="11">9</option>
    <option value="12">9.5</option>
    <option value="13">10</option>
    <option value="14">10.5</option>
    <option value="15">11</option>
    <option value="16">11.5</option>
    <option value="17">12</option>
    <option value="18">12.5</option>
    <option value="19">13</option>
    <option value="20">13.5</option>
    </select>
    Thanks.

  6. #6
    eXtreme Programmer .paul.'s Avatar
    Join Date
    May 2007
    Location
    Chelmsford UK
    Posts
    21,674

    Re: Clicking List Item with webbrowser

    Yep it sent. I replied...

Posting Permissions

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



Featured


Click Here to Expand Forum to Full Width


×
By using this site, you agree to the Privacy Policy