python wiki question

R

ruud habets

Hi,

Does anybody know how to determine if a wiki page is a redirectpage
using the wikipedia-scripts? It must be something like

if IsRedirectPage() == False:
text_file.write("\n")

But I cannot seem to get it working.

thnx
Ruud
 
R

ruud habets

ruud habets schreef:
Hi,

Does anybody know how to determine if a wiki page is a redirectpage
using the wikipedia-scripts? It must be something like

if IsRedirectPage() == False:
text_file.write("\n")

But I cannot seem to get it working.

thnx
Ruud
problem solved:

def workon(page):
try:
text = page.get()
except wikipedia.IsRedirectPage:
return

text_file.write(page.title().encode("utf-8"))
text_file.write("\n")
text_file.write(page.get().encode("utf-8"))
text_file.write("\n")
print page

thnx anyway
ruud
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,754
Messages
2,569,527
Members
44,998
Latest member
MarissaEub

Latest Threads

Top