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;