TOOLSP
"
WELCOME !

Please ! USE [CODE] tags for your LINKS and CODE.

Favor usar balisas [CODE] para sus vínculos y código.

Merci d'utiliser les balises [CODE] pour vos liens et code.


[code]http://Thank.you[/code]
"
*** Doc. Kodi & PYthon ***
.
.
Python & Modules PY
.
.
.
.
(Video) Cache Kodi
.
.
.
Addons Kodi
.
.
.
Addons Kodi
.
.
*** GITHUB ***
.
.
URLresolver (J.S.) [GIT] +
.
.
.
URLresolver (elD.) [GIT] -
.
.
URLresolver (tvA.) [GIT] -
.
.
.
.
Cloudflare (external) [GIT]
.
.
.
*** Associated ***
.
Pastebin Your list online
.
mediafire Upload Files
.
imgur Upload Pics
lyngsat TV logos collection
transparent .png
.
http://hola.org free? VPN
Hola.apk free? VPN App.
.
hidester- free Proxy
.
webgrabplus EPG - Eng
xmltv EPG - Fr
kazer EPG - Fr
.
.wordreference Traduction
.
mail.com (fast sign-in)
.
.
FRIENDS / PARTNERS

£$π community

créer un forum


Parsing: view Text without HTML-TAG

Go down

Parsing: view Text without HTML-TAG Empty Parsing: view Text without HTML-TAG

Post by vbprofi on Mon 22 Apr - 16:48

Hello,
give a simple way to exclude all html-tags from text?
for example, I have this code, how I can parse without html-tag hole text for viewing?
Code:

<item>
<title>epg text</title>
<link>$doregex[info]</link>

<regex>
<name>info</name>
<expres><![CDATA[#$pyFunction
import re
import xbmcgui
import xbmc
def GetLSProData(page_data,Cookie_Jar,m):#vbprofi
 txt = re.findall('<span class="tabtextbold">(?s)(.*?)<a href="', page_data)[0].replace('</span>', ' ').replace('<br/>', '\n').replace('<BR/>', '\n')
 dialog = xbmcgui.Dialog()
 dialog.textviewer('Programm-Information', txt)
 return null
]]></expres>
<page>https://www.hoerzu.de/text/tv-programm/detail.php?broadcast_id=139214011&seite=s&timeday=ganztags&newday=0&tvchannelid=71</page>
</regex>
</item>

vbprofi

Messages : 89
Date d'inscription : 2017-05-03

View user profile

Back to top Go down

Parsing: view Text without HTML-TAG Empty Re: Parsing: view Text without HTML-TAG

Post by vbprofi on Mon 22 Apr - 17:10

this code is remove all html-tags, but I need a replace function for breakline (\n) for better reading.
Code:

def cleanhtml(raw_html):
 cleanr = re.compile('<.*?>')
 cleantext = re.sub(cleanr, '', raw_html)
 return cleantext.replace('&nbsp;', ' ')
have someone an idea?

vbprofi

Messages : 89
Date d'inscription : 2017-05-03

View user profile

Back to top Go down

Parsing: view Text without HTML-TAG Empty Re: Parsing: view Text without HTML-TAG

Post by oxus on Tue 23 Apr - 17:13

hy,
try this
Code:
<item>
<title>epg text</title>
<link>$doregex[info]</link>

<regex>
<name>info</name>
<expres><![CDATA[#$pyFunction
import re
import xbmcgui
import xbmc
def GetLSProData(page_data,Cookie_Jar,m):#vbprofi
 txt = re.findall('<span class="tabtextbold">(?s)(.*?)<a href="', page_data)[0]
 cleanr = re.compile('<.*?>')
 cleantext = re.sub(cleanr, '', txt)
 dialog = xbmcgui.Dialog()
 dialog.textviewer('Programm-Information', cleantext)
 return null
]]></expres>
<page>https://www.hoerzu.de/text/tv-programm/detail.php?broadcast_id=139214011&seite=s&timeday=ganztags&newday=0&tvchannelid=71</page>
</regex>
</item>

oxus

Messages : 9
Date d'inscription : 2017-04-17

View user profile

Back to top Go down

Parsing: view Text without HTML-TAG Empty Re: Parsing: view Text without HTML-TAG

Post by Sponsored content


Sponsored content


Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum