1

Is there some function in python for joining element.text with the same Element.tag names?

Example:

 p>     
        some text
        <i>(</i>
        <i>something</i>
        <i>something</i>
        <i>)</i>
        some text
        <i>proň, zač</i>
        the end of paragraph
    </p>

What I want:

 p>     
        some text
        <i>(something something)</i>
        some text
        <i>proň, zač</i>
        the end of paragraph
    </p>

1 Answer 1

1

Is there some function in python for joining element.text with same tags name?

No, you must code it yourself. The reason is that the library deals with xml, not just xhtml. In general, <tag>a</tag><tag>b</tag> does not have the same meaning as <tag>ab</tag>. In fact, even in html, consolidating adjacent <p> or <block> tags would change the meaning of the text.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.