title: How to solve "Unresolved attribute reference for class"
body: <p>I have been working on a small project which is a web-crawler template. Im having an issue in pycharm where I am getting a warning <code>Unresolved attribute reference 'domain' for class 'Scraper'</code></p>
  <pre><code>from abc import abstractmethod
  
  import requests
  import tldextract
  
  
  class Scraper:
      scrapers = {}
  
      def __init_subclass__(scraper_class):
          Scraper.scrapers[scraper_class.domain] = scraper_class # Unresolved attribute reference 'domain' for class 'Scraper'
  
      @classmethod
      def for_url(cls, url):
          k = tldextract.extract(url)
          # Returns -&gt; &lt;scraper.SydsvenskanScraper object at 0x000001E94F135850&gt; &amp; Scraped BBC News&lt;!DOCTYPE html&gt;&lt;html Which type annotiation?
          return cls.scrapers[k.registered_domain](url)
  
      @abstractmethod
      def scrape(self):
          pass
  
  
  class BBCScraper(Scraper):
      domain = 'bbc.co.uk'
  
      def __init__(self, url):
          self.url = url
  
      def scrape(self):
          rep = requests.Response = requests.get(self.url)
          return &quot;Scraped BBC News&quot; + rep.text[:20]  # ALL HTML CONTENT
  
  
  class SydsvenskanScraper(Scraper):
      domain = 'sydsvenskan.se'
  
      def __init__(self, url):
          self.url = url
  
      def scrape(self):
          rep = requests.Response = requests.get(self.url)
          return &quot;Scraped Sydsvenskan News&quot; + rep.text[:20]  # ALL HTML CONTENT
  
  
  if __name__ == &quot;__main__&quot;:
      URLS = ['https://www.sydsvenskan.se/', 'https://www.bbc.co.uk/']
      for urls in URLS:
          get_product = Scraper.for_url(urls)
          r = get_product.scrape()
          print(r)
  </code></pre>
  <p>Of course I could ignore it as it is working but I do not like to ignore a warning as I believe pycharm is smart and should solve the warning rather than ignoring it and I wonder what is the reason of it warns me regarding that?</p>