title: How to scrape mobile phone numbers using beautifulsoup
body: <p>I want to scrape just mobile phones with below formats:</p>
  <pre><code>+1 NXX-NXX-XXXX
  
  N=digits 2–9, X=digits 0–9
  
  +1 is the country code that includes the US, there are 17 other countries, e.g., Canada, Caribbean Islands.
  </code></pre>
  <p>Assume we need to find every numbers that started by 986 and 965 and etc (we have a set of this numbers) as first NXX.</p>
  <p>This is my code to get emails:</p>
  <pre><code>    email = soup(text=re.compile(r'[A-Za-z0-9\.\+_-]+@[A-Za-z0-9\._-]+\.[a-zA-Z]*'))
  
      _emailtokens = str(email).replace(&quot;\\t&quot;, &quot;&quot;).replace(&quot;\\n&quot;, &quot;&quot;).split(' ')
  
      if len(_emailtokens):
          print([match.group(0) for token in _emailtokens for match in [re.search(r&quot;([a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\.[a-zA-Z0-9-.]+)&quot;, str(token.strip()))] if match])
  </code></pre>
  <p>But I need to change it to get mobile phones.</p>