Automate html file editing with python - Change the author
I'm going to try writing a few different versions of your program. I think it would make for a nice, basic comparison of the various alternatives.
Of course, this all hinges on the number of changes, and their complexity, you wish to make. In that regard, it would be nice to get some more information on those changes, even if you haven't written the code for it yet.

Pure lxml, .find() with a simple XPath expression.
from lxml import etree

parser = etree.HTMLParser()
tree = etree.parse('../resources/author_parser_test_1.html', parser=parser)

author_tag = tree.find(&quot;./head/meta[@name='author']&quot;)

if author_tag is None:
    print(&quot;Couldn't find author tag&quot;)
else:
    author_tag.set('content', 'New Author')
    tree.write('../out/author_parser_test_1_res.html', method='html', pretty_print=False)


BeautifulSoup using lxml as the parser
from bs4 import BeautifulSoup

with open('../resources/author_parser_test_1.html', 'r') as file_1:
    soup = BeautifulSoup(file_1, features='lxml')

author_tag = soup.find('meta', attrs={'name': 'author'})

if author_tag is None:
    print(&quot;Couldn't find author tag&quot;)
else:
    author_tag['content'] = 'New author'
    with open('../out/author_parser_test_1_res.html', 'w') as file_1:
        file_1.write(soup.prettify())


I will keep updating this post as I work.