<分区> 分区>
我有两个 Python 脚本:
脚本 1:检查网页上的元素并将它们写入文件。
脚本 2:从此文件读取并将内容用作 if 语句的参数。
这是我不确定的部分。
文本文件至少有 500 项全部换行,我想在重新访问该网站时检查这些项目是否仍然存在。
def read_input_file(self):
inFile = open("page_items.txt","r")
if inFile == current_content:
do.stuff
解决此问题的最佳方法是什么?
