【发布时间】:2022-01-25 10:51:45
【问题描述】:
进口机械化 从 bs4 导入 BeautifulSoup 进口时间 导入smtplib
默认为真
当真时:
url = "https://www.google.com"
browser = mechanize.Browser()
browser.open(url)
response = browser.response().read()
soup = BeautifulSoup(response, "lxml")
count = 1
if str(soup).find("English") == -1:
# wait 60 seconds (change the time(in seconds) as you wish),
print('Checking - ' + str(count) + 'th Time')
time.sleep(60)
count += 1
# continue with the script
continue
【问题讨论】:
-
这个只能搜索“英文”关键字我要添加更多关键字
-
搜索多个词,如果该词出现在网站上我需要提醒
标签: python