Sets title from read one.

This commit is contained in:
Natalia Portillo 2017-05-10 03:40:58 +01:00
parent afc5e5724d
commit 762a3822f7
No known key found for this signature in database
GPG Key ID: 51D20488C724CA9F

17
wrp.py
View File

@ -240,8 +240,13 @@ if sys.platform == "linux" or sys.platform == "linux2":
% (__version__)) % (__version__))
httpout.write("<!-- Request for [%s] frame [%s] -->\n" httpout.write("<!-- Request for [%s] frame [%s] -->\n"
% (WebkitRenderer.req_url, web_url)) % (WebkitRenderer.req_url, web_url))
httpout.write("<HTML><HEAD><TITLE>WRP%s:%s</TITLE></HEAD>\n<BODY>\n" httpout.write("<HTML><HEAD>")
% (__version__, web_url)) # Get title
for ttl in frame.findAllElements('title'):
httpout.write((u"<TITLE>%s</TITLE>"
% ttl.toPlainText()).encode('utf-8', errors='ignore'))
break # Don't repeat bad HTML coding with several title marks
httpout.write("</HEAD>\n<BODY>\n")
if ISMAP == "true": if ISMAP == "true":
httpout.write("<A HREF=\"http://%s\">" httpout.write("<A HREF=\"http://%s\">"
@ -535,8 +540,12 @@ elif sys.platform == "darwin":
% (__version__)) % (__version__))
httpout.write("<!-- Request for [%s] frame [%s] -->\n" httpout.write("<!-- Request for [%s] frame [%s] -->\n"
% (WebkitLoad.req_url, web_url)) % (WebkitLoad.req_url, web_url))
httpout.write("<HTML><HEAD><TITLE>WRP%s:%s</TITLE></HEAD>\n<BODY>\n" # Get title
% (__version__, web_url)) for ttl in frame.findAllElements('title'):
httpout.write((u"<TITLE>%s</TITLE>"
% ttl.toPlainText()).encode('utf-8', errors='ignore'))
break # Don't repeat bad HTML coding with several title marks
httpout.write("</HEAD>\n<BODY>\n")
if ISMAP == "true": if ISMAP == "true":
httpout.write("<A HREF=\"http://%s\">" httpout.write("<A HREF=\"http://%s\">"
"<IMG SRC=\"http://%s\" ALT=\"wrp-render\" ISMAP>\n" "<IMG SRC=\"http://%s\" ALT=\"wrp-render\" ISMAP>\n"