The following code will take care of writing to a file.
# See note 1.
with open("save.txt", mode="a") as file: # See note 2.
contents = file.write(f"bsObj.title: {bsObj.title}\nbsObj.h1: {bsObj.h1}")
The above with statement will take care of opening and closing the file. It should be sufficient, and obviously the layout of contents is simply pulling the attributes you wanted into the file through a combined string variable. You can re-work the attribute as your needs dictate.
Note 1: If the file does exist it will append. If there is a chance the file might not exist I'd suggest try/except error handling.
Note 2: You might want to have a sub-directory and edit the path for this file. As-is this is writing to the same directory as the python file. Also, you can also use "w" to write rather than append. "r" for read is the default attribute.