Python Forum
Delimiters - How to skip some html tags from being translate
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Delimiters - How to skip some html tags from being translate
#1
hello. I made a Python script, that translate my html pages languages in other language. This is my english html page that I want to translate in Belarusian, check HERE You can save it for testing

And this is my Python code. The entire code HERE:

The code is ok, the translation is ok except one thing. Some tags are also been translated, this are the tags I don't want to be translated:

Quote:delimitatori_text_interior_articol = [['<h1 class="den_articol" itemprop="name', '</h1>'], ['<p class="text_obisnuit', '</p>'], ['<span class="text', '</span>'], ['<p class="text_obisnuit2">', '</p>'], ['<em>', '<em>']]

but the tag <p class="text_obisnuit2"> </p> is still translated in other languages. For example in Belarusian, it becomes <span клас = «Text_obisnuit2»> </span>

Can anyone find a solution and edit my code?
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  why doesn't it replace all html tags? Melcu54 3 692 Jul-05-2023, 04:47 AM
Last Post: Melcu54
  googletrans library to translate text language for using data frame is not running gcozba2023 0 1,163 Mar-06-2023, 09:50 AM
Last Post: gcozba2023
  Tkinterweb (Browser Module) Appending/Adding Additional HTML to a HTML Table Row AaronCatolico1 0 877 Dec-25-2022, 06:28 PM
Last Post: AaronCatolico1
  BeautifulSoup - I can't translate html tags that contain <a href=..</a> OR <em></em> Melcu54 10 1,564 Oct-27-2022, 08:58 AM
Last Post: wavic
  Get text from within h3 html tags Pedroski55 8 4,166 Jan-05-2022, 06:50 AM
Last Post: Larz60+
  need to skip password prompt, continue... tester_V 2 1,437 Oct-19-2021, 05:49 PM
Last Post: tester_V
  How to Translate a python code written in Mac-OS to Windows? alexanderDennisEnviro500 2 2,638 Jul-31-2021, 08:36 AM
Last Post: Gribouillis
  reading html and edit chekcbox to html jacklee26 5 3,020 Jul-01-2021, 10:31 AM
Last Post: snippsat
  Parsing link from html tags with Python Melcu54 0 1,575 Jun-14-2021, 09:25 AM
Last Post: Melcu54
  Parse String between 2 Delimiters and add as single list items lastyle 5 3,284 Apr-11-2021, 11:03 PM
Last Post: lastyle

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020