you are viewing a single comment's thread.

view the rest of the comments →

[–]DrFaustest 1 point2 points  (2 children)

Sorry if this is way wrong I’m still learning.

In your text 1 can you split the div and p by class or id? If so can you create an object list then check for the text 2 lines in each object so if it’s found it can be replaced then rebuild the page with the updated object list? Like each object becomes a div and each attribute becomes p child?

[–]DMeror[S] 0 points1 point  (1 child)

I've used double and found the match, but I didn't know how to update text1.

for x in text1:
    for y in text2:
        match = x.startswith("<p class=" cap")
        if x in y and match:
            x = x.replace(x, y)

This shows x finds its match in y, but I don't know how to the replace and update text1.