with open("games.txt", "w") as text_file:
print(driver.current_url)
text_file.write(driver.current_url + "\n")
我现在正在使用这段代码,但是当它写入文件时,它会覆盖旧内容。如何简单地添加内容而不删除已经存在的内容。
with open("games.txt", "w") as text_file:
print(driver.current_url)
text_file.write(driver.current_url + "\n")
我现在正在使用这段代码,但是当它写入文件时,它会覆盖旧内容。如何简单地添加内容而不删除已经存在的内容。