From c7ffe3d424ae1d654094d929efa3d97ebb695465 Mon Sep 17 00:00:00 2001 From: admin Date: Mon, 22 Jun 2015 07:14:55 +0000 Subject: [PATCH] =?UTF-8?q?nothing=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: svn://192.168.0.12/source@153 8346c931-da38-4b9b-9d4c-e48b93cbd075 --- CrawlerProcess/scrawler.cpp | 21 +++++++++++++++++---- CrawlerProcess/scrawler.h | 1 + 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/CrawlerProcess/scrawler.cpp b/CrawlerProcess/scrawler.cpp index 9cc637a..4287d68 100644 --- a/CrawlerProcess/scrawler.cpp +++ b/CrawlerProcess/scrawler.cpp @@ -26,7 +26,7 @@ SCrawler::~SCrawler() void SCrawler::load(QStringList _strlistArgv) { m_bUse = false; - + m_bNothing = false; if (_strlistArgv[0] == "naver") { if (_strlistArgv[1] == "news_list") @@ -217,13 +217,25 @@ void SCrawler::saveResult(bool ok) deleteProxy(); break; } - - if (m_bLast) cout << "last"; + if (m_bNothing == false) + { + cout << "nothing"; + m_bNothing = true; + } + if (m_bLast) + { + cout << "last"; + m_bLast = false; + } break; case E_NAVER_BLOG_REPLY: case E_DAUM_BLOG_REPLY: - cout << "ok"; + if (m_bUse) + { + cout << "ok"; + m_bUse = false; + } break; case E_NAVER_CAFE_DATA: case E_NAVER_BLOG_BODY: @@ -1584,6 +1596,7 @@ void SCrawler::saveFrameNewsList(QWebFrame *frame) QString str = Find(eleSub,"a","class","go_naver").attribute("href"); if (str.trimmed().isEmpty()) continue; if (str.contains("http://sports")) continue; + m_bNothing = true; cout << "o " << str.toStdString() << endl; } } diff --git a/CrawlerProcess/scrawler.h b/CrawlerProcess/scrawler.h index c56f1a1..ccbe680 100644 --- a/CrawlerProcess/scrawler.h +++ b/CrawlerProcess/scrawler.h @@ -46,6 +46,7 @@ private: bool m_bUse; bool m_bLast; bool m_bError; + bool m_bNothing; QString m_strProxyIP; int m_nProxyPort;