diff --git a/wrp.py b/wrp.py
index e8d1d00..355b7c8 100755
--- a/wrp.py
+++ b/wrp.py
@@ -240,8 +240,13 @@ if sys.platform == "linux" or sys.platform == "linux2":
% (__version__))
httpout.write("\n"
% (WebkitRenderer.req_url, web_url))
- httpout.write("
WRP%s:%s\n\n"
- % (__version__, web_url))
+ httpout.write("")
+ # Get title
+ for ttl in frame.findAllElements('title'):
+ httpout.write((u"%s"
+ % ttl.toPlainText()).encode('utf-8', errors='ignore'))
+ break # Don't repeat bad HTML coding with several title marks
+ httpout.write("\n\n")
if ISMAP == "true":
httpout.write(""
@@ -535,8 +540,12 @@ elif sys.platform == "darwin":
% (__version__))
httpout.write("\n"
% (WebkitLoad.req_url, web_url))
- httpout.write("WRP%s:%s\n\n"
- % (__version__, web_url))
+ # Get title
+ for ttl in frame.findAllElements('title'):
+ httpout.write((u"%s"
+ % ttl.toPlainText()).encode('utf-8', errors='ignore'))
+ break # Don't repeat bad HTML coding with several title marks
+ httpout.write("\n\n")
if ISMAP == "true":
httpout.write(""
"\n"