Skip to content
This repository was archived by the owner on Jan 18, 2020. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions Sina2WordPressCore.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,11 @@ def __init__(self, interface, sina_url, wordpress_admin, wordpress_url):
msg = '(%d/%d) Analyzing Comment: %s' % (count, total, comment_url, )
interface.progress_update(msg, count, total)

comment_text, comment_id = comment_analyze(
comment_url, comment_id, sina_admin, wordpress_admin, wordpress_url)
try:
comment_text, comment_id = comment_analyze(
comment_url, comment_id, sina_admin, wordpress_admin, wordpress_url)
except:
break

if comment_text:
text.append(comment_text)
Expand Down Expand Up @@ -180,7 +183,10 @@ def post_analyze(url, wordpress_admin):
page = urlopen_request(request)
#headers['Referer'] = url

post_title = content_clear(post_title_pattern.search(page).group(1))
try:
post_title = content_clear(post_title_pattern.search(page).group(1))
except:
return '',''
post_time = post_time_pattern.search(page).group(1)
post_content = content_clear(post_content_pattern.search(page).group(1))

Expand Down