title: Python using re.compile html to set website update alert
body: <p>I would like to set an alert if the website has any update.
  Seems I need to use re.compile to set regular expression, but I am not familiar with that, I use:</p>
  <pre><code>def Request():
      headers = {'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.128 Safari/537.36'}     
      req = requests.get('https://xueqiu.com/u/4357540281', headers=headers)   
      content = req.content    
      pattern = re.compile('.html').findall(content) #how
      return pattern 
  
  def update():
      print('In progress')
      old_pattern = Request() 
      while True:
          new_pattern = Request() 
          if (new_pattern!= old_pattern):  
              old_pattern=new_pattern    
              send_email()  
          else:
              now=datetime.datetime.now()
              print(now,&quot;No Update&quot;)
          time.sleep(300)
              
              
  def send_email():
  </code></pre>
  <p>Any help will be highly appreciated! thanks!</p>