![]() |
![]() |
![]()
Post
#1
|
|
Grupa: Zarejestrowani Postów: 1 447 Pomógł: 191 Dołączył: 26.03.2008 Ostrzeżenie: (0%) ![]() ![]() |
Mam taki kodzik :
Kod QWebPage page; QWebFrame * frame = page.mainFrame(); frame->setHtml(str); QWebElement document = frame->documentElement(); QWebElementCollection tables = document.findAll(".table"); int numTables = tables.count(); qDebug() << numTables; return; Pod zmienną str znajduje się źródło tej strony : http://panoramafirm.pl/szukaj/mazowieckie,...wa/firmy,1.html Chcę pobrać ilość elementów o klasie table. Niestety program podaje, że tych elementów jest 0. Podczas gdy w rzczywistości jest ich 15. Gdy zamiast ".table" dam "a", to zwraca mi to 17, czyli jakieś linki znajduje ale chyba jest ich ciut za mało. W czym może być problem ? Wszystkie tabelki są w divie o klasie "results" <- tego diva nie mogę pobrać. Mogę za to pobrać div o nazwię 'socialIcons right" ale nie w całości - na nim program kończy parsowanie. Ten post edytował peter13135 4.08.2012, 16:07:05 -------------------- :)
|
|
|
![]() |
![]()
Post
#2
|
|
Grupa: Zarejestrowani Postów: 1 447 Pomógł: 191 Dołączył: 26.03.2008 Ostrzeżenie: (0%) ![]() ![]() |
Kod frame->setHtml(str); qDebug() << frame->toHtml(); Dziwna sprawa. Ostatnie linijki tego "debuga" to: Kod <div class="socialIcons right"> <!-- AddThis Button BEGIN --> <span class="shareItText left">Podziel się wynikami</span> <div class="addthis_toolbox addthis_default_style"> <a class="addthis_button_facebook" title="dodaj do facebook'a"></a> <a class="addthis_button_google" title="dodaj do google'a"></a> <a class="addthis_button_compact" title="dodaj do innych"></a> </div> <script type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js#pubid=xa-4fe954876fcacb33"></script></div></div></div></div></div></div></div></body></html>" Za tym divem (socialIcons) powinien być jeden pusty div z klasą "clear" i potem div reslults z tabelkami. -------------------- :)
|
|
|
![]() ![]() |
![]() |
Wersja Lo-Fi | Aktualny czas: 14.08.2025 - 19:38 |