네이버블로그 크롤링 오류 수정
git-svn-id: svn://192.168.0.12/source@265 8346c931-da38-4b9b-9d4c-e48b93cbd075
This commit is contained in:
@@ -724,10 +724,21 @@ void SCrawler::saveFrameComment(QWebFrame *frame)
|
||||
QString strParent,strDate,strNick,strComm,strUrl,strId;
|
||||
QStringList strList = m_strUrl.split("/");
|
||||
QString strCommUrl;
|
||||
for (int i=0; i < strList.size(); i++)
|
||||
for (int i=0; i < strList.size() - 1; i++)
|
||||
strUrl += strList.at(i) + "/";
|
||||
|
||||
strUrl = strUrl.left(strUrl.size()-1);
|
||||
{
|
||||
int nStartIdPos = m_strUrl.indexOf("blogId=") + QString("blogId=").size();
|
||||
int nEndIdPos = m_strUrl.indexOf('&', nStartIdPos);
|
||||
strUrl += m_strUrl.mid(nStartIdPos, nEndIdPos - nStartIdPos) + '/';
|
||||
|
||||
}
|
||||
|
||||
{
|
||||
int nStartIdPos = m_strUrl.indexOf("logNo=") + QString("logNo=").size();
|
||||
int nEndIdPos = m_strUrl.indexOf('&', nStartIdPos);
|
||||
strUrl += m_strUrl.mid(nStartIdPos, nEndIdPos - nStartIdPos);
|
||||
}
|
||||
|
||||
int nCount=0;
|
||||
foreach (QWebElement element, elements)
|
||||
@@ -771,11 +782,11 @@ void SCrawler::saveFrameComment(QWebFrame *frame)
|
||||
query.prepare(QString("insert into " + m_strTable + " (article_url,platform_id,article_nickname,article_data,article_date,reply_url,article_order,platform_name,platform_form,article_form) VALUES (:URL,:PLATFORMID,:NICK,:DATA,:DATE,:URLREPLY,:ROWNUM,'naver','blog','reply')").toUtf8());
|
||||
|
||||
|
||||
int nStartIdPos = strUrl.indexOf("blogId=") + QString("blogId=").size();
|
||||
int nEndIdPos = strUrl.indexOf('&', nStartIdPos);
|
||||
int nStartIdPos = m_strUrl.indexOf("blogId=") + QString("blogId=").size();
|
||||
int nEndIdPos = m_strUrl.indexOf('&', nStartIdPos);
|
||||
|
||||
query.bindValue(":URL", strUrl.toUtf8());
|
||||
query.bindValue(":PLATFORMID",strUrl.mid(nStartIdPos, nEndIdPos - nStartIdPos));
|
||||
query.bindValue(":PLATFORMID",m_strUrl.mid(nStartIdPos, nEndIdPos - nStartIdPos));
|
||||
query.bindValue(":NICK",strNick.toUtf8());
|
||||
query.bindValue(":DATA",strComm.toUtf8());
|
||||
query.bindValue(":DATE",strDate.toUtf8());
|
||||
@@ -829,11 +840,11 @@ void SCrawler::saveFrameComment(QWebFrame *frame)
|
||||
else
|
||||
query.prepare(QString("insert into " + m_strTable + " (article_url,platform_id,article_nickname,article_data,article_date,article_parent,reply_url,article_order,platform_name,platform_form,article_form) VALUES (:URL,:PLATFORMID,:NICK,:DATA,:DATE,:PARENT,:URLREPLY,:ROWNUM,'naver','blog','reply')").toUtf8());
|
||||
|
||||
int nStartIdPos = strUrl.indexOf("blogId=") + QString("blogId=").size();
|
||||
int nEndIdPos = strUrl.indexOf('&', nStartIdPos);
|
||||
int nStartIdPos = m_strUrl.indexOf("blogId=") + QString("blogId=").size();
|
||||
int nEndIdPos = m_strUrl.indexOf('&', nStartIdPos);
|
||||
|
||||
query.bindValue(":URL",strUrl.toUtf8());
|
||||
query.bindValue(":PLATFORMID",strUrl.mid(nStartIdPos, nEndIdPos - nStartIdPos));
|
||||
query.bindValue(":PLATFORMID",m_strUrl.mid(nStartIdPos, nEndIdPos - nStartIdPos));
|
||||
query.bindValue(":NICK",strNick.toUtf8());
|
||||
query.bindValue(":DATA",strComm.toUtf8());
|
||||
query.bindValue(":DATE",strDate.toUtf8());
|
||||
|
||||
Reference in New Issue
Block a user