Results 1 to 4 of 4

Thread: Webelements

  1. #1
    Join Date
    Feb 2014
    Posts
    3
    Thanks
    1
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default Webelements

    Hello Dear Qt-ers!

    I don't understand these webelements. I did across the exampless also.
    So could you answer, how can I get the value "20:45", using webelements, from the web site which has the following structure ?! :

    Qt Code:
    1. <body class="soccer _fs gecko gecko27 os-win32">
    2. <div class="container">
    3. <div class="adsclear"></div>
    4. <div id="header"></div>
    5. <div class="content">
    6. <div id="main">
    7. <div id="rc-top"></div>
    8. <div id="tc">
    9. <div id="mc">
    10. <div id="box-over-content-a" style="display: inline;"></div>
    11. <div id="box-over-content-b" style="display: none;"></div>
    12. <div id="box-inner-content-a" style="display: none;"></div>
    13. <div id="box-over-content-d" style="display: none;"></div>
    14. <div id="lang-box-wrapper" style="display: none;"></div>
    15. <script type="text/javascript"></script>
    16. <div id="fsbody" class="flashscore" title="">
    17. <div id="fs_overlay" style="display: none;"></div>
    18. <div id="fsi"></div>
    19. <div id="fscon" title="">
    20. <div id="preload" class="preload pvisit" style="display: none;"></div>
    21. <ul class="ifmenu live-menu" title=""></ul>
    22. <div id="fs" class="fs-table" style="opacity: 1;">
    23. <div id="iframe-box-inner-content-a" style="display: none;"></div>
    24. <div class="odds-content">
    25. <table class="odds soccer" title="">
    26. <colgroup></colgroup>
    27. <thead></thead>
    28. <tbody title="">
    29. <tr id="g_1_277gVqT4" class="tr-first stage-finished" title="" style="cursor: pointer;">
    30. <td class="cell_ib icons left"></td>
    31. <td class="cell_ad time">
    32. [COLOR="#FF0000"]20:45[/COLOR]
    33. </td>
    To copy to clipboard, switch view to plain text mode 

    Thank you for the answer in advance!

  2. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Webelements

    What is "webelements"?

  3. #3
    Join Date
    Feb 2014
    Posts
    3
    Thanks
    1
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Webelements

    Thank you ChrisW67 for answering me!

    I am trying to get webelements with this code:

    QWebElement document = frame->documentElement();
    QWebElementCollection elements = document.findAll("td.\"cell_ad time\"");

  4. #4
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Webelements

    Try
    Qt Code:
    1. QWebElementCollection elements = document.findAll("td.cell_ad");
    2. // or
    3. QWebElementCollection elements = document.findAll("td.time");
    4. // or
    5. QWebElementCollection elements = document.findAll("td.cell_ad.time");
    To copy to clipboard, switch view to plain text mode 
    "We can't solve problems by using the same kind of thinking we used when we created them." -- Einstein
    If you are posting code then please use [code] [/code] tags around it - makes addressing the problem easier.

Similar Threads

  1. Access to WebElements through (Qt) WebKit2 Touch API
    By webkitresearch in forum Qt Programming
    Replies: 2
    Last Post: 28th March 2013, 20:12

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.